stop creating intermediate AR objects, just construct AR objects from a list of hashes

This commit is contained in:
Aaron Patterson
2011-01-07 18:45:17 -08:00
parent 84f81f5779
commit 36d7bd1898

View File

@@ -188,7 +188,8 @@ module ActiveRecord
def find_with_associations
including = (@eager_load_values + @includes_values).uniq
join_dependency = ActiveRecord::Associations::ClassMethods::JoinDependency.new(@klass, including, [])
rows = construct_relation_for_association_find(join_dependency).to_a
relation = construct_relation_for_association_find(join_dependency)
rows = connection.exec_query(relation.to_sql, 'SQL', relation.bind_values)
join_dependency.instantiate(rows)
rescue ThrowResult
[]