aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/acts
diff options
context:
space:
mode:
authorMichael Koziarski <michael@koziarski.com>2006-01-14 09:26:14 +0000
committerMichael Koziarski <michael@koziarski.com>2006-01-14 09:26:14 +0000
commit62d749ab0ef1787e050537bd9a6f833b30f1331d (patch)
treeed9e8cdc7cd685fd9a910137c277d4470fc4fb96 /activerecord/lib/active_record/acts
parent88dae722022b84bc7b16680f5113959952fb2df2 (diff)
downloadrails-62d749ab0ef1787e050537bd9a6f833b30f1331d.tar.gz
rails-62d749ab0ef1787e050537bd9a6f833b30f1331d.tar.bz2
rails-62d749ab0ef1787e050537bd9a6f833b30f1331d.zip
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
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 ce1c59d422..0e0e1e4f36 100644
--- a/activerecord/lib/active_record/acts/list.rb
+++ b/activerecord/lib/active_record/acts/list.rb
@@ -174,7 +174,7 @@ module ActiveRecord
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