Module: ActiveSupport::Deprecation

Defined in:
lib/monetra/active_support/deprecation.rb

Defined Under Namespace

Modules: Assertions, ClassMethods Classes: DeprecatedInstanceVariableProxy

Constant Summary collapse

DEFAULT_BEHAVIORS =

Choose the default warn behavior according to RAILS_ENV. Ignore deprecation warnings in production.

{
  'test'        => Proc.new { |message| $stderr.puts message },
  'development' => Proc.new { |message| RAILS_DEFAULT_LOGGER.warn message },
}

Class Method Summary collapse

Class Method Details

.default_behaviorObject



15
16
17
# File 'lib/monetra/active_support/deprecation.rb', line 15

def default_behavior
  DEFAULT_BEHAVIORS[RAILS_ENV.to_s] if defined?(RAILS_ENV)
end

.warn(message = nil, callstack = caller) ⇒ Object



11
12
13
# File 'lib/monetra/active_support/deprecation.rb', line 11

def warn(message = nil, callstack = caller)
  behavior.call(deprecation_message(callstack, message)) if behavior
end