aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record
diff options
context:
space:
mode:
authorRafael Mendonça França + Kassio Borges <rafaelmfranca+kassioborgesm@gmail.com>2013-08-31 14:53:28 -0300
committerRafael Mendonça França + Kassio Borges <rafaelmfranca+kassioborgesm@gmail.com>2013-08-31 14:53:28 -0300
commitbf2c4280563ba5f86072c1bad8af27ff5e5da0f3 (patch)
tree5cd1483a8a43efbad3f81d8b7aafb81f36509f60 /activerecord/lib/active_record
parentadbd04ff8026d7b920f887e82334657f4914ff04 (diff)
downloadrails-bf2c4280563ba5f86072c1bad8af27ff5e5da0f3.tar.gz
rails-bf2c4280563ba5f86072c1bad8af27ff5e5da0f3.tar.bz2
rails-bf2c4280563ba5f86072c1bad8af27ff5e5da0f3.zip
Don't need to check if the scope respond to call
We are checking this when defining the default scope and raising an ArgumentError
Diffstat (limited to 'activerecord/lib/active_record')
-rw-r--r--activerecord/lib/active_record/scoping/default.rb6
1 files changed, 1 insertions, 5 deletions
diff --git a/activerecord/lib/active_record/scoping/default.rb b/activerecord/lib/active_record/scoping/default.rb
index a5d6aad3f0..01fec31544 100644
--- a/activerecord/lib/active_record/scoping/default.rb
+++ b/activerecord/lib/active_record/scoping/default.rb
@@ -100,11 +100,7 @@ module ActiveRecord
elsif default_scopes.any?
evaluate_default_scope do
default_scopes.inject(relation) do |default_scope, scope|
- if !scope.is_a?(Relation) && scope.respond_to?(:call)
- default_scope.merge(unscoped { scope.call })
- else
- default_scope.merge(scope)
- end
+ default_scope.merge(unscoped { scope.call })
end
end
end