aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--activerecord/CHANGELOG4
-rw-r--r--activerecord/lib/active_record/acts/list.rb2
2 files changed, 4 insertions, 2 deletions
diff --git a/activerecord/CHANGELOG b/activerecord/CHANGELOG
index 447ce724e4..12d91b5a98 100644
--- a/activerecord/CHANGELOG
+++ b/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]
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