aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord
diff options
context:
space:
mode:
authorDavid Heinemeier Hansson <david@loudthinking.com>2005-07-10 05:31:29 +0000
committerDavid Heinemeier Hansson <david@loudthinking.com>2005-07-10 05:31:29 +0000
commitc0f84b117ca08e7959062f17c216060d68d46b0c (patch)
tree071f0109d053794d03b65936bb39c334e3cf3404 /activerecord
parent14e7c7c21dcffd8f4388883eb241e0cc0ad23bbc (diff)
downloadrails-c0f84b117ca08e7959062f17c216060d68d46b0c.tar.gz
rails-c0f84b117ca08e7959062f17c216060d68d46b0c.tar.bz2
rails-c0f84b117ca08e7959062f17c216060d68d46b0c.zip
Fixed that assume_bottom_position (in acts_as_list) could be called on items already last in the list and they would move one position away from the list #1648 [tyler@kianta.com]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1796 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'activerecord')
-rw-r--r--activerecord/CHANGELOG2
-rw-r--r--activerecord/lib/active_record/acts/list.rb2
2 files changed, 3 insertions, 1 deletions
diff --git a/activerecord/CHANGELOG b/activerecord/CHANGELOG
index 26b8c52d59..2dca819dfb 100644
--- a/activerecord/CHANGELOG
+++ b/activerecord/CHANGELOG
@@ -1,5 +1,7 @@
*SVN*
+* Fixed that assume_bottom_position (in acts_as_list) could be called on items already last in the list and they would move one position away from the list #1648 [tyler@kianta.com]
+
* Added ActiveRecord::Base.threaded_connections flag to turn off 1-connection per thread (required for thread safety). By default it's on, but WEBrick in Rails need it off #1685 [Sam Stephenson]
* Correct reflected table name for singular associations. #1688 [court3nay@gmail.com]
diff --git a/activerecord/lib/active_record/acts/list.rb b/activerecord/lib/active_record/acts/list.rb
index 6c908c88a4..29b5a0a58e 100644
--- a/activerecord/lib/active_record/acts/list.rb
+++ b/activerecord/lib/active_record/acts/list.rb
@@ -173,7 +173,7 @@ module ActiveRecord
end
def assume_bottom_position
- update_attribute(position_column, bottom_position_in_list.to_i + 1)
+ update_attribute(position_column, bottom_position_in_list.to_i + 1) unless last?
end
def assume_top_position