Permalink
Browse files

expanded comment for update_attribute method

  • Loading branch information...
1 parent bcec0f6 commit 767de13ff4a19a53d3fe99edb5554040cb6e5e60 Neeraj Singh committed Jul 20, 2010
Showing with 9 additions and 2 deletions.
  1. +9 −2 activerecord/lib/active_record/persistence.rb
@@ -102,8 +102,15 @@ def becomes(klass)
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 || {}

0 comments on commit 767de13

Please sign in to comment.