Permalink
Browse files

Don't hardcode id in acts_as_list. Closes #3370

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3421 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
  • Loading branch information...
1 parent 88dae72 commit 62d749ab0ef1787e050537bd9a6f833b30f1331d @NZKoz NZKoz committed Jan 14, 2006
Showing with 4 additions and 2 deletions.
  1. +3 −1 activerecord/CHANGELOG
  2. +1 −1 activerecord/lib/active_record/acts/list.rb
View
@@ -1,8 +1,10 @@
*SVN*
+* Don't hardcode 'id' in acts as list. [ror@philippeapril.com]
+
* Fix date errors for SQLServer in association tests. #3406 [kevin.clark@gmal.com]
-r Escape database name in MySQL adapter when creating and dropping databases. #3409 [anna@wota.jp]
+* Escape database name in MySQL adapter when creating and dropping databases. #3409 [anna@wota.jp]
* Disambiguate table names for columns in validates_uniquness_of's WHERE clause. #3423 [alex.borovsky@gmail.com]
@@ -174,7 +174,7 @@ def bottom_position_in_list(except = nil)
def bottom_item(except = nil)
conditions = scope_condition
- conditions = "#{conditions} AND id != #{except.id}" if except
+ conditions = "#{conditions} AND #{self.class.primary_key} != #{except.id}" if except
acts_as_list_class.find(:first, :conditions => conditions, :order => "#{position_column} DESC")
end

0 comments on commit 62d749a

Please sign in to comment.