Hi John
Hi,
What's the best way to hook into any changes made to the value of a
single model attribute? I need to know when the encrypted_password
attribute on my User model changes i.e. when the user has changed their
password. I'm not interested in the actual changed value, I just need to
know when it's been changed so that I can regenerate their API key as
well.
cch: You should look into callbacks. For example, I use
def after_update(record)
log(record, "UPDATE")
end
to record whether a change has been made