Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

no need for lvar

  • Loading branch information...
commit 7c1275a005f8ed1820a93069c90d515b2f7a8e1a 1 parent d99c790
@jonleighton jonleighton authored
Showing with 1 addition and 3 deletions.
  1. +1 −3 activerecord/lib/active_record/scoping/named.rb
View
4 activerecord/lib/active_record/scoping/named.rb
@@ -176,7 +176,7 @@ def scope(name, scope_options = {})
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 @@ def scope(name, scope_options = {})
extension ? relation.extending(extension) : relation
end
-
- singleton_class.send(:redefine_method, name, &scope_proc)
end
protected
Please sign in to comment.
Something went wrong with that request. Please try again.