From 75ac9c4271df65b94b2a6862d87b1ec42f676efe Mon Sep 17 00:00:00 2001 From: Aaron Patterson Date: Sat, 25 Dec 2010 16:38:59 -0700 Subject: use arel to determine selection column --- activerecord/lib/active_record/association_preload.rb | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'activerecord') diff --git a/activerecord/lib/active_record/association_preload.rb b/activerecord/lib/active_record/association_preload.rb index 5feda5db0c..3409ca9099 100644 --- a/activerecord/lib/active_record/association_preload.rb +++ b/activerecord/lib/active_record/association_preload.rb @@ -378,7 +378,6 @@ module ActiveRecord def find_associated_records(ids, reflection, preload_options) options = reflection.options table = reflection.klass.arel_table - table_name = reflection.klass.quoted_table_name conditions = [] @@ -392,7 +391,7 @@ module ActiveRecord conditions += append_conditions(reflection, preload_options) find_options = { - :select => preload_options[:select] || options[:select] || Arel.sql("#{table_name}.*"), + :select => preload_options[:select] || options[:select] || table[Arel.star], :include => preload_options[:include] || options[:include], :joins => options[:joins], :group => preload_options[:group] || options[:group], -- cgit v1.2.3