method
update_column
v3.2.13 -
Show latest stable
- Class:
ActiveRecord::Persistence
update_column(name, value)public
Updates a single attribute of an object, without calling save.
-
Validation is skipped.
-
Callbacks are skipped.
-
updated_at/updated_on column is not updated if that column is available.
Raises an ActiveRecordError when called on new objects, or when the name attribute is marked as readonly.
1Note
Use `update_all` for Updating the Same Column for Multiple Records.
http://apidock.com/rails/ActiveRecord/Relation/update_all
Client.where( country: 'Canada' ).update_all( country_code: 'CA' )