From 684e4d39d60d87273ea74f9a076b3ea308fc2ffe Mon Sep 17 00:00:00 2001 From: Pratik Naik Date: Sat, 3 Apr 2010 01:22:42 +0100 Subject: Remove unnecessary argument for creating scopes --- activerecord/lib/active_record/named_scope.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'activerecord/lib/active_record/named_scope.rb') diff --git a/activerecord/lib/active_record/named_scope.rb b/activerecord/lib/active_record/named_scope.rb index d56f7afb74..86a18f8b6b 100644 --- a/activerecord/lib/active_record/named_scope.rb +++ b/activerecord/lib/active_record/named_scope.rb @@ -107,7 +107,7 @@ module ActiveRecord "Overwriting existing method #{self.name}.#{name}." end - scopes[name] = lambda do |parent_scope, *args| + scopes[name] = lambda do |*args| scope_options = case options when Hash, Relation options @@ -116,9 +116,9 @@ module ActiveRecord end relation = if scope_options.is_a?(Hash) - parent_scope.scoped.apply_finder_options(scope_options) + scoped.apply_finder_options(scope_options) else - scope_options ? parent_scope.scoped.merge(scope_options) : parent_scope.scoped + scope_options ? scoped.merge(scope_options) : scoped end block_given? ? relation.extending(Module.new(&block)) : relation @@ -126,7 +126,7 @@ module ActiveRecord singleton_class.instance_eval do define_method name do |*args| - scopes[name].call(self, *args) + scopes[name].call(*args) end end end -- cgit v1.2.3