diff options
author | Jon Leighton <j@jonathanleighton.com> | 2012-03-21 20:23:46 +0000 |
---|---|---|
committer | Jon Leighton <j@jonathanleighton.com> | 2012-03-21 20:23:46 +0000 |
commit | 7c1275a005f8ed1820a93069c90d515b2f7a8e1a (patch) | |
tree | a12c71552a17adc9d6b9798dd357bdea783a0bc3 /activerecord/lib | |
parent | d99c790f65204520690c20f5789148f3c7e2bce8 (diff) | |
download | rails-7c1275a005f8ed1820a93069c90d515b2f7a8e1a.tar.gz rails-7c1275a005f8ed1820a93069c90d515b2f7a8e1a.tar.bz2 rails-7c1275a005f8ed1820a93069c90d515b2f7a8e1a.zip |
no need for lvar
Diffstat (limited to 'activerecord/lib')
-rw-r--r-- | activerecord/lib/active_record/scoping/named.rb | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/activerecord/lib/active_record/scoping/named.rb b/activerecord/lib/active_record/scoping/named.rb index 0edc3f1dcc..22f18afe6f 100644 --- a/activerecord/lib/active_record/scoping/named.rb +++ b/activerecord/lib/active_record/scoping/named.rb @@ -176,7 +176,7 @@ module ActiveRecord valid_scope_name?(name) extension = Module.new(&Proc.new) if block_given? - scope_proc = lambda do |*args| + singleton_class.send(:redefine_method, name) do |*args| options = scope_options.respond_to?(:call) ? unscoped { scope_options.call(*args) } : scope_options options = scoped.apply_finder_options(options) if options.is_a?(Hash) @@ -184,8 +184,6 @@ module ActiveRecord extension ? relation.extending(extension) : relation end - - singleton_class.send(:redefine_method, name, &scope_proc) end protected |