<commit_before>require "active_support/lazy_load_hooks"
require "active_support/concern"

require "active_record_sharding/version"
require "active_record_sharding/error"

module ActiveRecordSharding
  if defined? Rails::Railtie
    class Railtie < ::Rails::Railtie
      rake_tasks do
        load "active_record_sharding/tasks/db.rake"
      end
    end
  end
end

ActiveSupport.on_load(:active_record) do
  require "active_record_sharding/config"

  require "active_record_sharding/model"
  ActiveRecord::Base.send(:include, ActiveRecordSharding::Model)

  require "active_record_sharding/connection"
  ActiveRecord::ConnectionAdapters::AbstractAdapter.class_eval do
    include ActiveRecordSharding::Connection
    ActiveRecordSharding::Connection::DESTRUCTIVE_METHODS.each do |method_name|
      alias_method_chain method_name, :sharding
    end
  end

  require "active_record_sharding/base"
  ActiveRecord::Base.send(:include, ActiveRecordSharding::Base)

  require "active_record_sharding/association"<commit_msg>Fix raise error in sharding:db:create task, close #1<commit_after>require "active_support/lazy_load_hooks"
require "active_support/concern"

require "active_record_sharding/version"
require "active_record_sharding/error"
require "active_record_sharding/config"

module ActiveRecordSharding
  if defined? Rails::Railtie
    class Railtie < ::Rails::Railtie
      rake_tasks do
        load "active_record_sharding/tasks/db.rake"
      end
    end
  end
end

ActiveSupport.on_load(:active_record) do
  require "active_record_sharding/model"
  ActiveRecord::Base.send(:include, ActiveRecordSharding::Model)

  require "active_record_sharding/connection"
  ActiveRecord::ConnectionAdapters::AbstractAdapter.class_eval do
    include ActiveRecordSharding::Connection
    ActiveRecordSharding::Connection::DESTRUCTIVE_METHODS.each do |method_name|
      alias_method_chain method_name, :sharding
    end
  end

  require "active_record_sharding/base"
  ActiveRecord::Base.send(:include, ActiveRecordSharding::Base)

  require "active_record_sharding/association"
{'fraction_non_alphanumeric': 0.07996146435452794, 'fraction_numerical': 0.0004816955684007707, 'mean_word_length': 6.088737201365188, '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': '3195286', 'n_tokens_mistral': 641, 'n_tokens_neox': 621, 'n_words': 110}