<commit_before># == Schema Information
#
# Table name: pieces
#
#  id             :integer          not null, primary key
#  title          :string(255)
#  composer_id    :integer
#  performance_id :integer
#  epoch_id       :integer
#  created_at     :datetime         not null
#  updated_at     :datetime         not null
#  minutes        :integer
#  seconds        :integer
#

# -*- encoding : utf-8 -*-
class Piece < ActiveRecord::Base
  attr_accessible :title, :composer_id, :performance_id, :epoch_id, :minutes, :seconds,
      :composer_attributes
  
  belongs_to :composer, dependent: :destroy # since every piece has its own composer
  belongs_to :performance, touch: true
  belongs_to :epoch
  
  accepts_nested_attributes_for :composer
  
  validates :title,       presence: true
  validates :epoch_id,    presence: true
  validates :minutes,     presence: true,
                          numericality: { only_integer: true },
                          inclusion: { in: 0..45 }
  validates :seconds,     presence: true,
                          numericality: { only_integer: true },
                          inclusion: { in: 0..59 }
                          
  def duration
    min*60 + sec
  end
end<commit_msg>Corrected wrong attribute names<commit_after># == Schema Information
#
# Table name: pieces
#
#  id             :integer          not null, primary key
#  title          :string(255)
#  composer_id    :integer
#  performance_id :integer
#  epoch_id       :integer
#  created_at     :datetime         not null
#  updated_at     :datetime         not null
#  minutes        :integer
#  seconds        :integer
#

# -*- encoding : utf-8 -*-
class Piece < ActiveRecord::Base
  attr_accessible :title, :composer_id, :performance_id, :epoch_id, :minutes, :seconds,
      :composer_attributes
  
  belongs_to :composer, dependent: :destroy # since every piece has its own composer
  belongs_to :performance, touch: true
  belongs_to :epoch
  
  accepts_nested_attributes_for :composer
  
  validates :title,       presence: true
  validates :epoch_id,    presence: true
  validates :minutes,     presence: true,
                          numericality: { only_integer: true },
                          inclusion: { in: 0..45 }
  validates :seconds,     presence: true,
                          numericality: { only_integer: true },
                          inclusion: { in: 0..59 }
                          
  def duration
    minutes*60 + seconds
  end
end
{'fraction_non_alphanumeric': 0.0846774193548387, 'fraction_numerical': 0.00967741935483871, 'mean_word_length': 2.00363196125908, 'pattern_counts': {'":': 0, '<': 5, '<?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': '7205475', 'n_tokens_mistral': 712, 'n_tokens_neox': 720, 'n_words': 198}