method

update_column

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.

joshuapinter ยท Nov 9, 2013

http://apidock.com/rails/ActiveRecord/Relation/update_all

Client.where( country: 'Canada' ).update_all( country_code: 'CA' )