<commit_before>class Todo < ActiveRecord::Base
  # Associations
  belongs_to :user

  # Accessors
  attr_accessible :name, :description, :user_id, :is_accomplished

  # Hooks
  before_create :before_create

  # Validators
  validates :uuid, :uniqueness => true
  validates :name, :presence => true
  validates :user, :presence => true

  # Named Scopes
  scope :accomplished,   lambda{ where("is_accomplished = ?", true) }
  scope :unaccomplished, lambda{ where("is_accomplished != ?", true) }

  def is_accomplished= state
    if state === true && ! (is_accomplished? === true)
      self.accomplished_at = Time.now
    elsif ! (state === true) && (is_accomplished? === true)
      self.accomplished_at = nil<commit_msg>Add TODO comment<commit_after>class Todo < ActiveRecord::Base
  # Associations
  belongs_to :user # TODO change the local name to author ?

  # Accessors
  attr_accessible :name, :description, :user_id, :is_accomplished

  # Hooks
  before_create :before_create

  # Validators
  validates :uuid, :uniqueness => true
  validates :name, :presence => true
  validates :user, :presence => true

  # Named Scopes
  scope :accomplished,   lambda{ where("is_accomplished = ?", true) }
  scope :unaccomplished, lambda{ where("is_accomplished != ?", true) }

  def is_accomplished= state
    if state === true && ! (is_accomplished? === true)
      self.accomplished_at = Time.now
    elsif ! (state === true) && (is_accomplished? === true)
      self.accomplished_at = nil
{'fraction_non_alphanumeric': 0.1224764468371467, 'fraction_numerical': 0.0, 'mean_word_length': 4.127586206896551, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 9, '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': '7512918', 'n_tokens_mistral': 522, 'n_tokens_neox': 491, 'n_words': 122}