Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add *_previously_was attribute methods when dirty tracking (#36836)
- Loading branch information
Showing
3 changed files
with
19 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,9 @@ | ||
* Add *_previously_was attribute methods when dirty tracking. Example: | ||
|
||
pirate.update(catchphrase: "Ahoy!") | ||
pirate.previous_changes["catchphrase"] # => ["Thar She Blows!", "Ahoy!"] | ||
pirate.catchphrase_previously_was # => "Thar She Blows!" | ||
|
||
*DHH* | ||
|
||
Please check [6-0-stable](https://github.com/rails/rails/blob/6-0-stable/activemodel/CHANGELOG.md) for previous changes. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters