Browse files

Relation should supply :from to find_with_associations

  • Loading branch information...
1 parent 7b5d0e8 commit 6f5e3a04d655e09c0a9a32fc94c752f84c7011f6 @lifo lifo committed Dec 27, 2009
Showing with 2 additions and 1 deletion.
  1. +2 −1 activerecord/lib/active_record/relation.rb
View
3 activerecord/lib/active_record/relation.rb
@@ -93,7 +93,8 @@ def to_a
:order => @relation.send(:order_clauses).join(', '),
:conditions => where_clause,
:limit => @relation.taken,
- :offset => @relation.skipped
+ :offset => @relation.skipped,
+ :from => @relation.send(:table_sql, Arel::Sql::TableReference.new(@relation))
},
ActiveRecord::Associations::ClassMethods::JoinDependency.new(@klass, @eager_load_associations, nil))
end

0 comments on commit 6f5e3a0

Please sign in to comment.