method
update_attribute
v4.2.7 -
Show latest stable
-
1 note -
Class: ActiveRecord::Persistence
- 1.0.0
- 1.1.6
- 1.2.6
- 2.0.3
- 2.1.0
- 2.2.1
- 2.3.8
- 3.0.0 (0)
- 3.0.9 (-5)
- 3.1.0 (0)
- 3.2.1 (0)
- 3.2.8 (38)
- 3.2.13 (-38)
- 4.0.2 (30)
- 4.1.8 (0)
- 4.2.1 (8)
- 4.2.7 (0)
- 4.2.9 (0)
- 5.0.0.1 (-1)
- 5.1.7 (0)
- 5.2.3 (0)
- 6.0.0 (0)
- 6.1.3.1 (0)
- 6.1.7.7 (0)
- 7.0.0 (0)
- 7.1.3.2 (0)
- 7.1.3.4 (0)
- What's this?
update_attribute(name, value)
public
Updates a single attribute and saves the record. This is especially useful for boolean flags on existing records. Also note that
-
Validation is skipped.
-
Callbacks are invoked.
-
updated_at/updated_on column is updated if that column is available.
-
Updates all the attributes that are dirty in this object.
This method raises an +ActiveRecord::ActiveRecordError+ if the attribute is marked as readonly.
See also update_column.
Register or
log in
to add new notes.
rfb -
February 29, 2012
1 thank
looking to bypass validations, callbacks and updated_at?
Take a look at updated_column
http://apidock.com/rails/ActiveRecord/Persistence/update_column