Skip to content

Instantly share code, notes, and snippets.

@caike
Created November 2, 2012 15:35
Show Gist options
  • Save caike/4002045 to your computer and use it in GitHub Desktop.
Save caike/4002045 to your computer and use it in GitHub Desktop.
update attribute
# 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