diff options
author | David Heinemeier Hansson <david@loudthinking.com> | 2005-01-06 02:31:35 +0000 |
---|---|---|
committer | David Heinemeier Hansson <david@loudthinking.com> | 2005-01-06 02:31:35 +0000 |
commit | d1abe806c54a0c0c845476715e47c52ca48cabab (patch) | |
tree | e80b7b355d37a2922b6f6d275b973249e4d27433 /activerecord/CHANGELOG | |
parent | fd48e70d6cc450cd2c5baa8eb7567246d59b34d1 (diff) | |
download | rails-d1abe806c54a0c0c845476715e47c52ca48cabab.tar.gz rails-d1abe806c54a0c0c845476715e47c52ca48cabab.tar.bz2 rails-d1abe806c54a0c0c845476715e47c52ca48cabab.zip |
Added Base#toggle(attribute) and Base#toggle!(attribute) that makes it easier to flip a switch or flag. Added Base#increment!(attribute) and Base#decrement!(attribute) that also saves the records. Added Base#increment(attribute) and Base#decrement(attribute) that encapsulates the += 1 and -= 1 patterns.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@340 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'activerecord/CHANGELOG')
-rw-r--r-- | activerecord/CHANGELOG | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/activerecord/CHANGELOG b/activerecord/CHANGELOG index be46c22096..cea70c095a 100644 --- a/activerecord/CHANGELOG +++ b/activerecord/CHANGELOG @@ -1,3 +1,22 @@ +*SVN* + +* Added Base#toggle(attribute) and Base#toggle!(attribute) that makes it easier to flip a switch or flag. + + Before: topic.update_attribute(:approved, !approved?) + After : topic.toggle!(:approved) + +* Added Base#increment!(attribute) and Base#decrement!(attribute) that also saves the records. Example: + + page.views # => 1 + page.increment!(:views) # executes an UPDATE statement + page.views # => 2 + + page.increment(:views).increment!(:views) + page.views # => 4 + +* Added Base#increment(attribute) and Base#decrement(attribute) that encapsulates the += 1 and -= 1 patterns. + + *1.4.0* (January 4th, 2005) * Added automated optimistic locking if the field <tt>lock_version</tt> is present. Each update to the |