From eb807384c81a6e086b17a576755e992e6c4c685e Mon Sep 17 00:00:00 2001 From: Ryuta Kamizono Date: Thu, 29 Mar 2018 05:30:01 +0900 Subject: Short circuit the scoping delegation for `relation.all` Previously `relation.all` behaves as `relation.scoping { klass.all }`. But it is just enough to `relation.spawn`. --- activerecord/lib/active_record/relation/spawn_methods.rb | 1 + 1 file changed, 1 insertion(+) (limited to 'activerecord') diff --git a/activerecord/lib/active_record/relation/spawn_methods.rb b/activerecord/lib/active_record/relation/spawn_methods.rb index 562e04194c..b092399657 100644 --- a/activerecord/lib/active_record/relation/spawn_methods.rb +++ b/activerecord/lib/active_record/relation/spawn_methods.rb @@ -10,6 +10,7 @@ module ActiveRecord def spawn #:nodoc: clone end + alias :all :spawn # Merges in the conditions from other, if other is an ActiveRecord::Relation. # Returns an array representing the intersection of the resulting records with other, if other is an array. -- cgit v1.2.3