Skip to content

Instantly share code, notes, and snippets.

@epitron
Forked from havenwood/setting_rails_attributes.md
Last active March 25, 2016 22:41
Show Gist options
  • Save epitron/77664694cb5ef9f17942 to your computer and use it in GitHub Desktop.
Save epitron/77664694cb5ef9f17942 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 Uses Default Accessor Validations Callbacks Touches updated_at Readonly check
update
update_attributes
update_columns
User::update
User::update_all
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment