Created
November 2, 2012 15:35
-
-
Save caike/4002045 to your computer and use it in GitHub Desktop.
update attribute
This file contains hidden or 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
# update_attribute | |
guitar.update_attribute(:state, 'used') | |
# method on model | |
class Guitar | |
def mark_as_used | |
self.state = 'used' | |
self.save | |
end | |
end | |
guitar.mark_as_used |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment