From 767de13ff4a19a53d3fe99edb5554040cb6e5e60 Mon Sep 17 00:00:00 2001 From: Neeraj Singh Date: Tue, 20 Jul 2010 06:56:20 -0400 Subject: expanded comment for update_attribute method --- activerecord/lib/active_record/persistence.rb | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/activerecord/lib/active_record/persistence.rb b/activerecord/lib/active_record/persistence.rb index 7ec443ccc7..68f5be63d6 100644 --- a/activerecord/lib/active_record/persistence.rb +++ b/activerecord/lib/active_record/persistence.rb @@ -102,8 +102,15 @@ module ActiveRecord became end - # Updates a single attribute and saves the record without going through the normal validation procedure - # or callbacks. This is especially useful for boolean flags on existing records. + # Updates a single attribute and saves the record. + # This is especially useful for boolean flags on existing records. Also note that + # + # * validation is skipped + # * No callbacks are invoked + # * updated_at/updated_on column is updated if that column is available + # * does not work on associations + # * does not work on attr_accessor attributes. The attribute that is being updated must be column name. + # def update_attribute(name, value) changes = record_update_timestamps || {} -- cgit v1.2.3