Inspect Previous Changes To ActiveRecord Object
PreviousInclude Devise Helpers In Your Controller TestsNextLink To The Current Page With Query Params
Last updated
Was this helpful?
Last updated
Was this helpful?
If you modify an ActiveRecord object, before saving it, you can inspect changes with methods like changed?
and <attr>_changed?
:
After saving an object, it will no longer be in a dirty state and these methods will have no changes to return.
If you have a reference to the saved ActiveRecord object, you can look at the previous changes with methods like previous_changes
and <attr>_previously_changed?
: