Created
September 2, 2015 09:12
-
-
Save szalansky/55424e7d4a5c50559228 to your computer and use it in GitHub Desktop.
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
product = Product.find 123 | |
product.title = “foo” | |
product.changed? # true | |
###### | |
product = Product.find 123 | |
product.title = “foo” | |
product.changed? # true | |
product.save # no matter if it succeeds or not | |
product.changed? # false | |
product.previous_changes["title"].nil? # false (shows all values of attribute since it has been fetched from the DB and instantiated) | |
# vide http://api.rubyonrails.org/classes/ActiveModel/Dirty.html |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment