<commit_before>module ActiveRecord
  module GlobalizeAccessors
    def self.included(base)
      base.extend ActMethods
    end
    
    module ActMethods
      def globalize_accessors(*attr_names)
        languages = attr_names
        attribs = globalize_options[:translated_attributes]
        attribs.each do |attr_name|
          languages.each do |with_locale|
            define_method :"#{attr_name}_#{with_locale}" do
              globalize.fetch with_locale, attr_name
            end

            define_method :"#{attr_name}_#{with_locale}=" do |val|
              globalize.stash with_locale, attr_name, val
              self[attr_name] = val
            end
          end
        end  
      end
    end
  end
end
<commit_msg>Model.translated_attribute_names now used instead of Model.globalize_options[:translated_attributes] -- compatible with latest globalize2<commit_after>module ActiveRecord
  module GlobalizeAccessors
    def self.included(base)
      base.extend ActMethods
    end
    
    module ActMethods
      def globalize_accessors(*attr_names)
        languages = attr_names
        attribs = translated_attribute_names
        attribs.each do |attr_name|
          languages.each do |with_locale|
            define_method :"#{attr_name}_#{with_locale}" do
              globalize.fetch with_locale, attr_name
            end

            define_method :"#{attr_name}_#{with_locale}=" do |val|
              globalize.stash with_locale, attr_name, val
              self[attr_name] = val
            end
          end
        end  
      end
    end
  end
end

{'fraction_non_alphanumeric': 0.06528562460765851, 'fraction_numerical': 0.0006277463904582549, 'mean_word_length': 2.168986083499006, 'pattern_counts': {'":': 0, '<': 3, '<?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': '4541532', 'n_tokens_mistral': 446, 'n_tokens_neox': 450, 'n_words': 103}