<commit_before>class LessonPlan < ActiveRecord::Base
  belongs_to :student
  validates_uniqueness_of :date
  validates_presence_of :date
  has_many :items, class_name: LessonPlanItem, dependent: :destroy

  audited
  has_associated_audits

  def duplicate!(from)
    transaction do
      from.items.each do |item|
        new_item = item.dup
        new_item.save
        self.items << new_item
      end
      self
    end
  end<commit_msg>Limit uniqueness of lesson plan date<commit_after>class LessonPlan < ActiveRecord::Base
  belongs_to :student
  validates_uniqueness_of :date, scope: :user_id
  validates_presence_of :date
  has_many :items, class_name: LessonPlanItem, dependent: :destroy

  audited
  has_associated_audits

  def duplicate!(from)
    transaction do
      from.items.each do |item|
        new_item = item.dup
        new_item.save
        self.items << new_item
      end
      self
    end
  end
{'fraction_non_alphanumeric': 0.06399132321041215, 'fraction_numerical': 0.0, 'mean_word_length': 3.1205357142857144, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4520669', 'n_tokens_mistral': 298, 'n_tokens_neox': 292, 'n_words': 72}