This is my hook method called after after_create :set_after_create in a model.
def set_after_create
passphrase = "#{id}+#{Time.zone.now.to_date}#{Rails.application.secrets.secret_key_base}"
update(
ref: CryptLib.sha1(passphrase),
token_key: CryptLib.sha1("#{passphrase}+#{Random.rand(20)}")
)
end
Now, I get a warning:
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 aftersavereturned (e.g. the opposite of what it returns now). To maintain the current behavior, usesaved_change_to_attribute?instead. (called from set_after_create at /app/app/models/project.rb:330)
I don't understand the connection between the alert and the method.
PS: I get no warning using the update_columns method, but I don't think that's the right way.
Config: Rails 5.1.4 and all gems updated.