diff options
author | Neeraj Singh <neerajdotname@gmail.com> | 2010-07-28 12:51:09 -0400 |
---|---|---|
committer | Neeraj Singh <neerajdotname@gmail.com> | 2010-07-28 12:51:36 -0400 |
commit | 51924d49af18635cab46720e208c34d75ed8363e (patch) | |
tree | 2b475dc195e9fe23eda57d516a1fe78c01fad7fd | |
parent | 7c3d479c4b8ae5667ead1163d4ce713c5ae73629 (diff) | |
download | rails-51924d49af18635cab46720e208c34d75ed8363e.tar.gz rails-51924d49af18635cab46720e208c34d75ed8363e.tar.bz2 rails-51924d49af18635cab46720e208c34d75ed8363e.zip |
more documentation for update_attribute
-rw-r--r-- | activerecord/lib/active_record/persistence.rb | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/activerecord/lib/active_record/persistence.rb b/activerecord/lib/active_record/persistence.rb index 869cbf5b2e..36530d2b63 100644 --- a/activerecord/lib/active_record/persistence.rb +++ b/activerecord/lib/active_record/persistence.rb @@ -105,13 +105,14 @@ module ActiveRecord # Updates a single attribute and saves the record. # This is especially useful for boolean flags on existing records. Also note that # - # * validation is skipped + # * The attribute being updated must be a column name. + # * 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. - # * does not work on new record. <tt>record.new_record?</tt> should return false for this method to work. - # * updates only the attribute that is input to the method. If there are other changed attributes then + # * Does not work on associations + # * Does not work on attr_accessor attributes. + # * Does not work on new record. <tt>record.new_record?</tt> should return false for this method to work. + # * Updates only the attribute that is input to the method. If there are other changed attributes then # those attributes are left alone. In that case even after this method has done its work <tt>record.changed?</tt> # will return true. # |