Class: Mongoid::Deprecation

Inherits:
ActiveSupport::Deprecation
  • Object
show all
Defined in:
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 'lib/mongoid/deprecation.rb', line 17

def behavior
  @behavior ||= Array(->(*args) {
    logger = Mongoid.logger
    logger.warn(args[0])
    logger.debug(args[1].join("\n  ")) if debug
  })
end