aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord
diff options
context:
space:
mode:
authorPratik Naik <pratiknaik@gmail.com>2010-04-03 01:22:42 +0100
committerPratik Naik <pratiknaik@gmail.com>2010-04-03 01:35:43 +0100
commit684e4d39d60d87273ea74f9a076b3ea308fc2ffe (patch)
tree490aaa2a489fe9cec6ec60379cf5c303a5184816 /activerecord
parent47c99f901257937c47a47953745624dd8469ec4b (diff)
downloadrails-684e4d39d60d87273ea74f9a076b3ea308fc2ffe.tar.gz
rails-684e4d39d60d87273ea74f9a076b3ea308fc2ffe.tar.bz2
rails-684e4d39d60d87273ea74f9a076b3ea308fc2ffe.zip
Remove unnecessary argument for creating scopes
Diffstat (limited to 'activerecord')
-rw-r--r--activerecord/lib/active_record/named_scope.rb8
1 files changed, 4 insertions, 4 deletions
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