After modifying an object and after saving to the database, or within after_save:
| Rails <= 5 | Rails >= 5.1 |
|---|---|
| attribute_changed? | saved_change_to_attribute? |
| changed? | saved_changes? |
| changes | saved_changes |
| attribute_was | attribute_before_last_save |
| previous_changes | no replacement, since the behavior for it changes |
After modifying an object and before saving to the database, or within before_save:
| Rails <= 5 | Rails >= 5.1 |
|---|---|
| attribute_changed? | will_save_change_to_attribute? |
| changed? | has_changes_to_save? |
| changes | changes_to_save |
| attribute_was | attribute_in_database |