aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record
diff options
context:
space:
mode:
authorJeremy Kemper <jeremy@bitsweat.net>2007-09-22 23:51:03 +0000
committerJeremy Kemper <jeremy@bitsweat.net>2007-09-22 23:51:03 +0000
commit4965b1b96163aa7bbc5f14d237683a12300e0798 (patch)
treef668f35153691c50ad8b688cfa6f35aad49e7a51 /activerecord/lib/active_record
parentf3bf372630bfc097887be156effd225a53e790a8 (diff)
downloadrails-4965b1b96163aa7bbc5f14d237683a12300e0798.tar.gz
rails-4965b1b96163aa7bbc5f14d237683a12300e0798.tar.bz2
rails-4965b1b96163aa7bbc5f14d237683a12300e0798.zip
Correctly quote id list for limited eager loading. Closes #7482.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7588 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'activerecord/lib/active_record')
-rwxr-xr-xactiverecord/lib/active_record/associations.rb6
1 files changed, 4 insertions, 2 deletions
diff --git a/activerecord/lib/active_record/associations.rb b/activerecord/lib/active_record/associations.rb
index a508a9c94d..cb821ba7f0 100755
--- a/activerecord/lib/active_record/associations.rb
+++ b/activerecord/lib/active_record/associations.rb
@@ -1256,12 +1256,14 @@ module ActiveRecord
throw :invalid_query
end
end
-
+
def select_limited_ids_list(options, join_dependency)
+ pk = columns_hash[primary_key]
+
connection.select_all(
construct_finder_sql_for_association_limiting(options, join_dependency),
"#{name} Load IDs For Limited Eager Loading"
- ).collect { |row| connection.quote(row[primary_key]) }.join(", ")
+ ).collect { |row| connection.quote(row[primary_key], pk) }.join(", ")
end
def construct_finder_sql_for_association_limiting(options, join_dependency)