Permalink
Browse files

Removed extra 'as' in :joins clause for habtm preloading

Signed-off-by: Michael Koziarski <michael@koziarski.com>

[#1405 state:committed]
  • Loading branch information...
1 parent dab78e5 commit 0c4ba90aa1ea6a8d386c724a55a31e63a13c46ab @foliosus foliosus committed with NZKoz Nov 18, 2008
Showing with 1 addition and 1 deletion.
  1. +1 −1 activerecord/lib/active_record/association_preload.rb
@@ -185,7 +185,7 @@ def preload_has_and_belongs_to_many_association(records, reflection, preload_opt
associated_records = reflection.klass.find(:all, :conditions => [conditions, ids],
:include => options[:include],
- :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}",
+ :joins => "INNER JOIN #{connection.quote_table_name options[:join_table]} t0 ON #{reflection.klass.quoted_table_name}.#{reflection.klass.primary_key} = t0.#{reflection.association_foreign_key}",
:select => "#{options[:select] || table_name+'.*'}, t0.#{reflection.primary_key_name} as the_parent_record_id",
:order => options[:order])

0 comments on commit 0c4ba90

Please sign in to comment.