Class: Mongoid::Deprecation

Inherits:
ActiveSupport::Deprecation
  • Object
show all
Defined in:
build/mongoid-master/lib/mongoid/deprecation.rb

Overview

Utility class for logging deprecation warnings.

Instance Method Summary collapse

Instance Method Details

#behaviorObject

Overrides default ActiveSupport::Deprecation behavior to use Mongoid's logger.



17
18
19
20
21
22
23
# File 'build/mongoid-master/lib/mongoid/deprecation.rb', line 17

def behavior
  @behavior ||= Array(->(message, callstack, _deprecation_horizon, _gem_name) {
    logger = Mongoid.logger
    logger.warn(message)
    logger.debug(callstack.join("\n  ")) if debug
  })
end