instance method
deprecated_method_warning
Ruby on Rails 7.2.3
Since v4.0.13 PrivateSignature
deprecated_method_warning(method_name, message = nil)
Outputs a deprecation warning message
deprecated_method_warning(:method_name) # => "method_name is deprecated and will be removed from Rails #{deprecation_horizon}" deprecated_method_warning(:method_name, :another_method) # => "method_name is deprecated and will be removed from Rails #{deprecation_horizon} (use another_method instead)" 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 115
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 115
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ActiveSupport::Deprecation::Reporting