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: discipline_content_record.rb
    path of file: ./repos/i-diario/app/models
    
    the code of the file until where you have to start completion: class DisciplineContentRecord < ActiveRecord::Base
  include Audit
  include ColumnsLockable
  include TeacherRelationable
  include Translatable

  not_updatable only: :discipline_id
  teacher_relation_columns only: :discipline

  audited associated_with: :content_record,
          except: [:content_record_id]
  acts_as_copy_target

  before_destroy :valid_for_destruction?

  belongs_to :content_record, dependent: :destroy
  accepts_nested_attributes_for :content_record

  belongs_to :discipline

  delegate :classroom_id, :classroom, to: :content_record

    
  def uniqueness_of_class_number
    discipline_content_record = DisciplineContentRecord.by_teacher_id(content_record.teacher_id)
                                                       .by_classroom_id(content_record.classroom_id)
                                                       .by_discipline_id(discipline_id)
                                                       .by_date(content_record.record_date)
                                                       .by_class_number(class_number)
                                                       .exists?

    if discipline_content_record
      errors.add(:class_number, I18n.t('activerecord.errors.models.discipline_content_record.attributes.discipline_id.class_number_in_use'))
    end