From 9281adc64acc5071c1d0d699158c97eae8430810 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafael=20Mendon=C3=A7a=20Fran=C3=A7a?= Date: Mon, 5 Aug 2013 18:27:46 -0300 Subject: [PATCH] Remove deprecated branch on the scope method. The deprecation message was removed on 50cbc03d18c5984347965a94027879623fc44cce but the code was not. --- activerecord/lib/active_record/scoping/named.rb | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/activerecord/lib/active_record/scoping/named.rb b/activerecord/lib/active_record/scoping/named.rb index 7c51aa6979..2a5718f388 100644 --- a/activerecord/lib/active_record/scoping/named.rb +++ b/activerecord/lib/active_record/scoping/named.rb @@ -142,12 +142,8 @@ def scope(name, body, &block) extension = Module.new(&block) if block singleton_class.send(:define_method, name) do |*args| - if body.respond_to?(:call) - scope = all.scoping { body.call(*args) } - scope = scope.extending(extension) if extension - else - scope = body - end + scope = all.scoping { body.call(*args) } + scope = scope.extending(extension) if extension scope || all end -- GitLab