<commit_before>class PhoneticForm < ActiveRecord::Base
#  has_and_belongs_to_many :headwords # why?
  has_many :orthographs
  has_many :headwords, :through => :orthographs
  has_many :notes, as: :annotatable
  translates :form, :fallbacks_for_empty_translations => true
  globalize_accessors :locales => (Language.defined_language_codes | [I18n.default_locale])
  accepts_nested_attributes_for :notes, :allow_destroy => true, :reject_if => proc { |attributes| attributes.all? {|k,v| v.blank?} }
 
  validate :any_form_present?
  
  protected
  def any_form_present?
    if globalize_attribute_names.select {|k,v| k.to_s.start_with?("form")}.all? {|v| v.blank? }
      errors.add(:form, I18n.t('errors.messages.blank'))
    end
  end
end<commit_msg>this is supposed to work these days<commit_after>class PhoneticForm < ActiveRecord::Base
#  has_and_belongs_to_many :headwords # why?
  has_many :orthographs
  has_many :headwords, :through => :orthographs
  has_many :notes, as: :annotatable
  translates :form, :fallbacks_for_empty_translations => true
  globalize_accessors :locales => (Language.defined_language_codes | [I18n.default_locale])
  accepts_nested_attributes_for :notes, allow_destroy: true, reject_if: :all_blank
 
  validate :any_form_present?
  
  protected
  def any_form_present?
    if globalize_attribute_names.select {|k,v| k.to_s.start_with?("form")}.all? {|v| v.blank? }
      errors.add(:form, I18n.t('errors.messages.blank'))
    end
  end
end
{'fraction_non_alphanumeric': 0.11716621253405994, 'fraction_numerical': 0.005449591280653951, 'mean_word_length': 5.528888888888889, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 11, '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': '4009657', 'n_tokens_mistral': 520, 'n_tokens_neox': 509, 'n_words': 101}