method
method_added
v7.1.3.2 -
Show latest stable
-
0 notes -
Class: ClassMethods
- 1.0.0
- 1.1.6
- 1.2.6
- 2.0.3
- 2.1.0
- 2.2.1
- 2.3.8
- 3.0.0
- 3.0.9
- 3.1.0
- 3.2.1
- 3.2.8
- 3.2.13
- 4.0.2 (0)
- 4.1.8 (0)
- 4.2.1 (0)
- 4.2.7 (0)
- 4.2.9 (0)
- 5.0.0.1 (0)
- 5.1.7 (0)
- 5.2.3 (0)
- 6.0.0 (0)
- 6.1.3.1 (0)
- 6.1.7.7 (0)
- 7.0.0 (0)
- 7.1.3.2 (0)
- 7.1.3.4 (0)
- What's this?
method_added(method_name)
public
Hide source
# File activesupport/lib/active_support/deprecation/instance_delegator.rb, line 20 def method_added(method_name) use_instead = case method_name when :silence, :behavior=, :disallowed_behavior=, :disallowed_warnings=, :silenced=, :debug= target = "(defined?(Rails.application.deprecators) ? Rails.application.deprecators : ActiveSupport::Deprecation._instance)" "Rails.application.deprecators.#{method_name}" when :warn, :deprecate_methods, :gem_name, :gem_name=, :deprecation_horizon, :deprecation_horizon= "your own Deprecation object" else "Rails.application.deprecators[framework].#{method_name} where framework is for example :active_record" end args = /[^\]]=\z/.match?(method_name) ? "arg" : "..." target ||= "ActiveSupport::Deprecation._instance" singleton_class.module_eval <<~RUBY, __FILE__, __LINE__ + 1 def #{method_name}(#{args}) #{target}.#{method_name}(#{args}) ensure ActiveSupport.deprecator.warn("Calling #{method_name} on ActiveSupport::Deprecation is deprecated and will be removed from Rails (use #{use_instead} instead)") end RUBY end