<commit_before>module ActiveRecord 
  module Acts
    module Opengraph
      
      def self.included(base)
        base.extend ActMethods
      end
      
      module ActMethods
        def acts_as_opengraph(options = {})
          # don't allow multiple calls
          return if included_modules.include? InstanceMethods
          
          extend ClassMethods
          
          opengraph_atts = %w(title type image url description site_name latitude longitude street_address locality region postal_code country_name email phone_number fax_number)
          
          options[:columns] ||= {}
          options[:values] ||= {}
          
          opengraph_atts.each do |att_name|
            options[:columns]["#{att_name}".to_sym] ||= alternative_column_name_for("og_#{att_name}".to_sym)
          end
          
          write_inheritable_attribute :opengraph_atts, opengraph_atts
          class_inheritable_reader :opengraph_atts
          
          write_inheritable_attribute :options, options
          class_inheritable_reader :options
          
          opengraph_atts.each do |att_name|
            define_method "opengraph_#{att_name}" do
              return_value_or_default att_name.to_sym
            end
          end<commit_msg>Replace class_inheritable_attribute with class_attribute to remove deprecation warnings<commit_after>module ActiveRecord 
  module Acts
    module Opengraph
      
      def self.included(base)
        base.extend ActMethods
      end
      
      module ActMethods
        def acts_as_opengraph(options = {})
          # don't allow multiple calls
          return if included_modules.include? InstanceMethods
          
          extend ClassMethods
          
          opengraph_atts = %w(title type image url description site_name latitude longitude street_address locality region postal_code country_name email phone_number fax_number)
          
          options[:columns] ||= {}
          options[:values] ||= {}
          
          opengraph_atts.each do |att_name|
            options[:columns]["#{att_name}".to_sym] ||= alternative_column_name_for("og_#{att_name}".to_sym)
          end
          
          class_attribute :opengraph_atts
          self.opengraph_atts = opengraph_atts
          
          class_attribute :options
          self.options = options
          
          opengraph_atts.each do |att_name|
            define_method "opengraph_#{att_name}" do
              return_value_or_default att_name.to_sym
            end
          end
{'fraction_non_alphanumeric': 0.06007905138339921, 'fraction_numerical': 0.0, 'mean_word_length': 2.0641646489104115, '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': '9025', 'n_tokens_mistral': 653, 'n_tokens_neox': 661, 'n_words': 144}