diff options
Diffstat (limited to 'activerecord/lib/active_record/relation')
-rw-r--r-- | activerecord/lib/active_record/relation/spawn_methods.rb | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/relation/spawn_methods.rb b/activerecord/lib/active_record/relation/spawn_methods.rb index 59cfca85ae..33df8fd06c 100644 --- a/activerecord/lib/active_record/relation/spawn_methods.rb +++ b/activerecord/lib/active_record/relation/spawn_methods.rb @@ -94,7 +94,9 @@ module ActiveRecord def apply_finder_options(options) options.assert_valid_keys(VALID_FIND_OPTIONS) - relation = joins(options[:joins]). + relation = spawn + + relation = relation.joins(options[:joins]). where(options[:conditions]). select(options[:select]). group(options[:group]). |