123456789_123456789_123456789_123456789_123456789_

Module: Mongoid::Config::DeprecatedOptions

Relationships & Source Files
Extension / Inclusion / Inheritance Descendants
Included In:
Defined in: lib/mongoid/config.rb

Constant Summary

Class Method Summary

Class Method Details

.prepended(klass)

[ GitHub ]

  
# File 'lib/mongoid/config.rb', line 431

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