Module: Mongoid::Config::DeprecatedOptions

Included in:
Mongoid::Config
Defined in:
lib/mongoid/config.rb

Constant Summary collapse

OPTIONS =
%i[

Class Method Summary collapse

Class Method Details

.prepended(klass) ⇒ Object



418
419
420
421
422
423
424
425
426
427
428
429
# File 'lib/mongoid/config.rb', line 418

def self.prepended(klass)
  klass.class_eval do
    OPTIONS.each do |option|
      alias_method :"#{option}_without_deprecation=", :"#{option}="

      define_method(:"#{option}=") do |value|
        Mongoid::Warnings.send(:"warn_#{option}_deprecated")
        send(:"#{option}_without_deprecation=", value)
      end
    end
  end
end