Permalink
Browse files

remove intermediate assignments

  • Loading branch information...
1 parent 5b527dc commit 4b87854e541a47a485bb3b34dc6d090a48b8cc9c @tenderlove tenderlove committed Aug 1, 2013
@@ -44,9 +44,8 @@ def initialize(name, scope, options)
validate_options
- if @scope && @scope.arity == 0
- prev_scope = @scope
- @scope = proc { instance_exec(&prev_scope) }
+ if scope && scope.arity == 0
+ @scope = proc { instance_exec(&scope) }
end
end
@@ -78,10 +78,8 @@ def #{name.to_s.singularize}_ids=(ids)
private
def wrap_scope(scope, mod)
- prev_scope = scope
-
- if prev_scope
- proc { |owner| instance_exec(owner, &prev_scope).extending(mod) }
+ if scope
+ proc { |owner| instance_exec(owner, &scope).extending(mod) }
else
proc { extending(mod) }
end

0 comments on commit 4b87854

Please sign in to comment.