aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib
diff options
context:
space:
mode:
authorRafael França <rafaelmfranca@gmail.com>2017-06-28 17:28:14 -0400
committerGitHub <noreply@github.com>2017-06-28 17:28:14 -0400
commit65b02ea56026b8747be65d64d99d6c90f7d04083 (patch)
treee0b64e0de273d619995ee460278f275708f0c50b /activerecord/lib
parent7f58b7dd490e22e6cc3e6a606a57c857b23c2704 (diff)
parent4bdd86fb1e608d0031ee5e03af4ae0b13b41fea3 (diff)
downloadrails-65b02ea56026b8747be65d64d99d6c90f7d04083.tar.gz
rails-65b02ea56026b8747be65d64d99d6c90f7d04083.tar.bz2
rails-65b02ea56026b8747be65d64d99d6c90f7d04083.zip
Merge pull request #29301 from kamipo/receiver_in_scope_should_be_relation
The receiver in a scope should be a `relation`
Diffstat (limited to 'activerecord/lib')
-rw-r--r--activerecord/lib/active_record/scoping/named.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/scoping/named.rb b/activerecord/lib/active_record/scoping/named.rb
index 388f471bf5..b4026fabb2 100644
--- a/activerecord/lib/active_record/scoping/named.rb
+++ b/activerecord/lib/active_record/scoping/named.rb
@@ -159,7 +159,7 @@ module ActiveRecord
if body.respond_to?(:to_proc)
singleton_class.send(:define_method, name) do |*args|
scope = all
- scope = scope.scoping { instance_exec(*args, &body) || scope }
+ scope = scope.instance_exec(*args, &body) || scope
scope = scope.extending(extension) if extension
scope
end