public
Description: Ruby on Rails
Homepage: http://rubyonrails.org
Clone URL: git://github.com/rails/rails.git
Fixed non-standard SQL generated by preloading has_and_belongs_to_many 
association.  [#394 state:resolved]
acangiano (author)
Wed Jun 11 12:25:19 -0700 2008
jeremy (committer)
Wed Jun 11 17:36:16 -0700 2008
commit  4689496b525526a776004c4986d98b0ce62309d5
tree    25e24f7cd3cf9176d476c9a9ceeac3a5a75dfe21
parent  c83a1839464a77cb774fc4a04cefa53b36248041
...
103
104
105
106
 
107
108
109
 
110
111
112
...
103
104
105
 
106
107
108
 
109
110
111
112
0
@@ -103,10 +103,10 @@ module ActiveRecord
0
         associated_records = reflection.klass.find(:all, :conditions => [conditions, ids],
0
         :include => options[:include],
0
         :joins => "INNER JOIN #{connection.quote_table_name options[:join_table]} as t0 ON #{reflection.klass.quoted_table_name}.#{reflection.klass.primary_key} = t0.#{reflection.association_foreign_key}",
0
-        :select => "#{options[:select] || table_name+'.*'}, t0.#{reflection.primary_key_name} as _parent_record_id",
0
+        :select => "#{options[:select] || table_name+'.*'}, t0.#{reflection.primary_key_name} as the_parent_record_id",
0
         :order => options[:order])
0
 
0
-        set_association_collection_records(id_to_record_map, reflection.name, associated_records, '_parent_record_id')
0
+        set_association_collection_records(id_to_record_map, reflection.name, associated_records, 'the_parent_record_id')
0
       end
0
 
0
       def preload_has_one_association(records, reflection, preload_options={})

Comments