Skip to content

Commit

Permalink
move the scope level key fully inside the scope object
Browse files Browse the repository at this point in the history
  • Loading branch information
tenderlove committed Aug 14, 2014
1 parent 911ef97 commit 19bb677
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion actionpack/lib/action_dispatch/routing/mapper.rb
Expand Up @@ -1654,7 +1654,7 @@ def with_exclusive_scope
end

def with_scope_level(kind)
@scope = @scope.new(:scope_level => kind)
@scope = @scope.new_level(kind)
yield
ensure
@scope = @scope.parent
Expand Down Expand Up @@ -1928,6 +1928,10 @@ def new(hash)
self.class.new hash, self
end

def new_level(level)
new(:scope_level => level)
end

def [](key)
@hash.fetch(key) { @parent[key] }
end
Expand Down

0 comments on commit 19bb677

Please sign in to comment.