instance method
deprecated_method_warning
Ruby on Rails 4.1.16
Since v4.0.13 PrivateSignature
deprecated_method_warning(method_name, message = nil)
Outputs a deprecation warning message
ActiveSupport::Deprecation.deprecated_method_warning(:method_name) # => "method_name is deprecated and will be removed from Rails #{deprecation_horizon}" ActiveSupport::Deprecation.deprecated_method_warning(:method_name, :another_method) # => "method_name is deprecated and will be removed from Rails #{deprecation_horizon} (use another_method instead)" ActiveSupport::Deprecation.deprecated_method_warning(:method_name, "Optional message") # => "method_name is deprecated and will be removed from Rails #{deprecation_horizon} (Optional message)"
Parameters
-
method_namereq -
messageopt = nil
Source
# File activesupport/lib/active_support/deprecation/reporting.rb, line 55
def deprecated_method_warning(method_name, message = nil)
warning = "#{method_name} is deprecated and will be removed from #{gem_name} #{deprecation_horizon}"
case message
when Symbol then "#{warning} (use #{message} instead)"
when String then "#{warning} (#{message})"
else warning
end
end
Defined in activesupport/lib/active_support/deprecation/reporting.rb line 55
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ActiveSupport::Deprecation::Reporting