From c0f84b117ca08e7959062f17c216060d68d46b0c Mon Sep 17 00:00:00 2001 From: David Heinemeier Hansson Date: Sun, 10 Jul 2005 05:31:29 +0000 Subject: 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 --- activerecord/CHANGELOG | 2 ++ activerecord/lib/active_record/acts/list.rb | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) 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 -- cgit v1.2.3