aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/acts
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/lib/active_record/acts
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/lib/active_record/acts')
-rw-r--r--activerecord/lib/active_record/acts/list.rb2
1 files changed, 1 insertions, 1 deletions
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