Refactor #22083
closedRails 5.1: attribute_changed? inside model callbacks
Description
These deprecations should get fixed:
ActiveSupport::DeprecationException: DEPRECATION WARNING: The behavior of `attribute_changed?` 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 `saved_change_to_attribute?` instead. (called from update_notifications at /Users/f0218175/foremandev/foreman_discovery/app/models/host/managed_extensions.rb:71)
ActiveSupport::DeprecationException: DEPRECATION WARNING: The behavior of `attribute_changed?` 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 `saved_change_to_attribute?` instead. (called from delete_discovery_attribute_set at /Users/f0218175/foremandev/foreman_discovery/app/models/host/managed_extensions.rb:66)
/Users/f0218175/foremandev/foreman_discovery/app/models/host/managed_extensions.rb:66:in `delete_discovery_attribute_set'