You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: library_entry.rb
    path of file: ./repos/kitsu-server/app/models
    
    the code of the file until where you have to start completion: class LibraryEntry < ApplicationRecord
  VALID_RATINGS = (2..20).to_a.freeze
  MEDIA_ASSOCIATIONS = %i[anime manga drama].freeze

  belongs_to :user
  belon
    
  def progress_limit
    return unless progress
    progress_cap = media&.progress_limit
    default_cap = [media&.default_progress_limit, 50].compact.max

    if progress_cap&.nonzero?
      errors.add(:progress, 'cannot exceed length of media') if progress > progress_cap
    elsif default_cap && progress > default_cap
      errors.add(:progress, 'is rather unreasonably high')
    end