aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord
diff options
context:
space:
mode:
authorRyuta Kamizono <kamipo@gmail.com>2018-03-29 05:30:01 +0900
committerRyuta Kamizono <kamipo@gmail.com>2018-03-30 09:35:05 +0900
commiteb807384c81a6e086b17a576755e992e6c4c685e (patch)
tree0a820ce30beebab3ee09b53fff13ec7c17e3f3fd /activerecord
parent06332d58676f58ef7970d3a8e0affe38f13feba3 (diff)
downloadrails-eb807384c81a6e086b17a576755e992e6c4c685e.tar.gz
rails-eb807384c81a6e086b17a576755e992e6c4c685e.tar.bz2
rails-eb807384c81a6e086b17a576755e992e6c4c685e.zip
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`.
Diffstat (limited to 'activerecord')
-rw-r--r--activerecord/lib/active_record/relation/spawn_methods.rb1
1 files changed, 1 insertions, 0 deletions
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 <tt>other</tt>, if <tt>other</tt> is an ActiveRecord::Relation.
# Returns an array representing the intersection of the resulting records with <tt>other</tt>, if <tt>other</tt> is an array.