<commit_before>class SpeciesList < ActiveRecord::Base
  has_and_belongs_to_many :observations
  belongs_to :user

  def species
    ''
  end
  
  def species=(list)
  end
  
  def unique_name
    title = self.title
    if title
      sprintf("%s (%d)", title[0..(MAX_FIELD_LENGTH-1)], self.id)
    else
      sprintf("Species List %d", self.id)
    end
  end
  
  def construct_observation(s, args)
    species_name = s.strip()
    if species_name != ''
      args["what"] = species_name
      obs = Observation.new(args)
      obs.save
      self.observations << obs
    end
  end
end
<commit_msg>Uses title as a default for where when observations are created from a species list that has no where.<commit_after>class SpeciesList < ActiveRecord::Base
  has_and_belongs_to_many :observations
  belongs_to :user

  def species
    ''
  end
  
  def species=(list)
  end
  
  def unique_name
    title = self.title
    if title
      sprintf("%s (%d)", title[0..(MAX_FIELD_LENGTH-1)], self.id)
    else
      sprintf("Species List %d", self.id)
    end
  end
  
  def construct_observation(s, args)
    species_name = s.strip()
    if species_name != ''
      args["what"] = species_name
      if args["where"] == ''
        args["where"] = self.title
      end
      obs = Observation.new(args)
      obs.save
      self.observations << obs
    end
  end
  
  validates_presence_of :title
end

{'fraction_non_alphanumeric': 0.10337401292175162, 'fraction_numerical': 0.002871500358937545, 'mean_word_length': 2.6302083333333335, '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': '5293567', 'n_tokens_mistral': 465, 'n_tokens_neox': 464, 'n_words': 119}