instance method
emit_warning_if_needed
Ruby on Rails 5.1.7
Since v5.1.7 Last seen in v5.1.7 Private — implementation detail, not part of the public APISignature
emit_warning_if_needed(method_name, new_method_name)
No documentation comment.
Parameters
-
method_namereq -
new_method_namereq
Source
# File activerecord/lib/active_record/attribute_methods/dirty.rb, line 249
def emit_warning_if_needed(method_name, new_method_name)
unless mutation_tracker.equal?(mutations_from_database)
ActiveSupport::Deprecation.warn(<<-EOW.squish)
The behavior of `#{method_name}` inside of after callbacks will
be changing in the next version of Rails. The new return value will reflect the
behavior of calling the method after `save` returned (e.g. the opposite of what
it returns now). To maintain the current behavior, use `#{new_method_name}`
instead.
EOW
end
end
Defined in activerecord/lib/active_record/attribute_methods/dirty.rb line 249
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ActiveRecord::AttributeMethods::Dirty