diff options
author | Michael Koziarski <michael@koziarski.com> | 2006-01-14 09:26:14 +0000 |
---|---|---|
committer | Michael Koziarski <michael@koziarski.com> | 2006-01-14 09:26:14 +0000 |
commit | 62d749ab0ef1787e050537bd9a6f833b30f1331d (patch) | |
tree | ed9e8cdc7cd685fd9a910137c277d4470fc4fb96 /activerecord | |
parent | 88dae722022b84bc7b16680f5113959952fb2df2 (diff) | |
download | rails-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')
-rw-r--r-- | activerecord/CHANGELOG | 4 | ||||
-rw-r--r-- | activerecord/lib/active_record/acts/list.rb | 2 |
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 |