Skip to content

Instantly share code, notes, and snippets.

@havenwood
Last active January 25, 2024 18:59
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save havenwood/dcdf9452476f53505b98 to your computer and use it in GitHub Desktop.
Save havenwood/dcdf9452476f53505b98 to your computer and use it in GitHub Desktop.
Cheat sheet for setting Rails attributes (from http://www.davidverhasselt.com/set-attributes-in-activerecord/)
Method Saves to DB Default Accessor Validations Callbacks Touches updated_at Readonly check
attribute=
write_attribute
update_attribute
attributes=
update
update_column
update_columns
::update
::update_all
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment