method

saved_change_to_attribute

Importance_1
v6.1.3.1 - Show latest stable - 0 notes - Class: ActiveRecord::AttributeMethods::Dirty
saved_change_to_attribute(attr_name) public

Returns the change to an attribute during the last save. If the attribute was changed, the result will be an array containing the original value and the saved value.

This method is useful in after callbacks, to see the change in an attribute during the save that triggered the callbacks to run. It can be invoked as saved_change_to_name instead of saved_change_to_attribute("name").

Show source
Register or log in to add new notes.