From 6f5e3a04d655e09c0a9a32fc94c752f84c7011f6 Mon Sep 17 00:00:00 2001 From: Pratik Naik Date: Sun, 27 Dec 2009 17:16:20 +0530 Subject: Relation should supply :from to find_with_associations --- activerecord/lib/active_record/relation.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'activerecord/lib/active_record/relation.rb') diff --git a/activerecord/lib/active_record/relation.rb b/activerecord/lib/active_record/relation.rb index c927270eee..f1d1fa0790 100644 --- a/activerecord/lib/active_record/relation.rb +++ b/activerecord/lib/active_record/relation.rb @@ -93,7 +93,8 @@ module ActiveRecord :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 -- cgit v1.2.3