<commit_before>require 'active_support/core_ext/module/delegation'
require 'active_support/core_ext/module/attribute_accessors'
require 'active_support/core_ext/string/inflections'


module Configuration

  # Start a configuration block in an initializer.
  #
  # example: Provide a default currency for the application
  #   Mongoid::Money.configure do |config|
  #     config.default_currency = :eur
  #   end
  def configure
    yield self
    #require 'mongoid/money/money'
  end

  # Configuration parameters

  def default_currency
    Money::Currency.new(Money.default_currency)
  end

  # Set default currency of money library
  def default_currency=(currency_name)
    Money.default_currency = currency_name
    set_amount_column_for_default_currency!
    set_currency_column_for_default_currency!
  end

  # Register a custom currency
  def register_currency=(currency_options)
    Money::Currency.register(currency_options)
  end

  def set_amount_column_for_default_currency!
    amount_column.merge! postfix: "_#{default_currency.subunit.downcase.pluralize}" if default_currency.subunit
  end

  def set_currency_column_for_default_currency!
    iso_code = default_currency.iso_code
    currency_column.merge! default: iso_code
  end

  def rounding_mode=(mode)<commit_msg>loading money class<commit_after>require 'active_support/core_ext/module/delegation'
require 'active_support/core_ext/module/attribute_accessors'
require 'active_support/core_ext/string/inflections'


module Configuration

  # Start a configuration block in an initializer.
  #
  # example: Provide a default currency for the application
  #   Mongoid::Money.configure do |config|
  #     config.default_currency = :eur
  #   end
  def configure
    yield self
    require 'mongoid/money/money'
  end

  # Configuration parameters

  def default_currency
    Money::Currency.new(Money.default_currency)
  end

  # Set default currency of money library
  def default_currency=(currency_name)
    Money.default_currency = currency_name
    set_amount_column_for_default_currency!
    set_currency_column_for_default_currency!
  end

  # Register a custom currency
  def register_currency=(currency_options)
    Money::Currency.register(currency_options)
  end

  def set_amount_column_for_default_currency!
    amount_column.merge! postfix: "_#{default_currency.subunit.downcase.pluralize}" if default_currency.subunit
  end

  def set_currency_column_for_default_currency!
    iso_code = default_currency.iso_code
    currency_column.merge! default: iso_code
  end

  def rounding_mode=(mode)
{'fraction_non_alphanumeric': 0.06558013193636011, 'fraction_numerical': 0.0, 'mean_word_length': 4.845804988662132, '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': '801021', 'n_tokens_mistral': 776, 'n_tokens_neox': 752, 'n_words': 163}