<commit_before>module Paperclip
  module S3
    if defined? Rails::Railtie # Don't break rails 2.x
      require 'rails'
      class Railtie < Rails::Railtie
        initializer 'paperclip.force_s3_attachment_on_production' do
          ActiveSupport.on_load :active_record do
            Paperclip::S3::Railtie.insert
          end
        end      
      end
    end

    class Railtie
      def self.insert
        ActiveRecord::Base.send(:include, Paperclip::S3::Glue)
      end 
    end
  end
end<commit_msg>Only use this on production<commit_after>module Paperclip
  module S3
    if defined? Rails::Railtie # Don't break rails 2.x
      require 'rails'
      class Railtie < Rails::Railtie
        initializer 'paperclip.force_s3_attachment_on_production' do
          ActiveSupport.on_load :active_record do
            Paperclip::S3::Railtie.insert
          end
        end      
      end
    end

    class Railtie
      def self.insert
        if (defined?(Rails.root) && Rails.root && Rails.root.production?) or
           (defined?(RAILS_ROOT) && RAILS_ROOT && RAILS_ROOT =~ /production/)
           
              ActiveRecord::Base.send(:include, Paperclip::S3::Glue)
      end 
    end
  end
end
{'fraction_non_alphanumeric': 0.08161582852431987, 'fraction_numerical': 0.008244023083264633, 'mean_word_length': 2.2116402116402116, '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': '5257400', 'n_tokens_mistral': 390, 'n_tokens_neox': 357, 'n_words': 86}