Skip to content

Commit

Permalink
remove intermediate assignments
Browse files Browse the repository at this point in the history
  • Loading branch information
tenderlove committed Aug 1, 2013
1 parent 5b527dc commit 4b87854
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
Expand Up @@ -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

Expand Down
Expand Up @@ -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
Expand Down

0 comments on commit 4b87854

Please sign in to comment.