<commit_before># frozen_string_literal: true

require_relative "active_record_where_assoc/version"
require "active_record"

module ActiveRecordWhereAssoc
  # Default options for the gem. Meant to be modified in place by external code
  def self.default_options
    @default_options ||= {
                           ignore_limit: false,
                           never_alias_limit: false,
                           poly_belongs_to: :raise,
                         }
  end
end

require_relative "active_record_where_assoc/core_logic"
require_relative "active_record_where_assoc/query_methods"
require_relative "active_record_where_assoc/querying"

ActiveSupport.on_load(:active_record) do
  ActiveRecord.eager_load!

  # Need to use #send for the include to support Ruby 2.0
  ActiveRecord::Relation.send(:include, ActiveRecordWhereAssoc::QueryMethods)<commit_msg>Add information about the default_options directly in the code<commit_after># frozen_string_literal: true

require_relative "active_record_where_assoc/version"
require "active_record"

module ActiveRecordWhereAssoc
  # Default options for the gem. Meant to be modified in place by external code, such as in
  # an initializer.
  # Ex:
  #   ActiveRecordWhereAssoc[:ignore_limit] = true
  #
  # A description for each can be found in ActiveRecordWhereAssoc::QueryMethods#where_assoc_exists.
  #
  # The only one that truly makes sense to change is :ignore_limit, when you are using MySQL, since
  # limit are never supported on it.
  def self.default_options
    @default_options ||= {
                           ignore_limit: false,
                           never_alias_limit: false,
                           poly_belongs_to: :raise,
                         }
  end
end

require_relative "active_record_where_assoc/core_logic"
require_relative "active_record_where_assoc/query_methods"
require_relative "active_record_where_assoc/querying"

ActiveSupport.on_load(:active_record) do
  ActiveRecord.eager_load!

  # Need to use #send for the include to support Ruby 2.0
  ActiveRecord::Relation.send(:include, ActiveRecordWhereAssoc::QueryMethods)
{'fraction_non_alphanumeric': 0.06099290780141844, 'fraction_numerical': 0.0018912529550827422, 'mean_word_length': 3.473572938689218, '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': '5878129', 'n_tokens_mistral': 602, 'n_tokens_neox': 591, 'n_words': 159}