Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
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...
commit 62d749ab0ef1787e050537bd9a6f833b30f1331d 1 parent 88dae72
@NZKoz NZKoz authored
View
4 activerecord/CHANGELOG
@@ -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]
View
2  activerecord/lib/active_record/acts/list.rb
@@ -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
Please sign in to comment.
Something went wrong with that request. Please try again.