From 19bb6770c0b4a7970a8c6daa2a1ed0f926e721f2 Mon Sep 17 00:00:00 2001 From: Aaron Patterson Date: Wed, 13 Aug 2014 19:24:40 -0700 Subject: move the scope level key fully inside the scope object --- actionpack/lib/action_dispatch/routing/mapper.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'actionpack/lib') diff --git a/actionpack/lib/action_dispatch/routing/mapper.rb b/actionpack/lib/action_dispatch/routing/mapper.rb index 77d9889f28..9c9c56fbce 100644 --- a/actionpack/lib/action_dispatch/routing/mapper.rb +++ b/actionpack/lib/action_dispatch/routing/mapper.rb @@ -1654,7 +1654,7 @@ module ActionDispatch end def with_scope_level(kind) - @scope = @scope.new(:scope_level => kind) + @scope = @scope.new_level(kind) yield ensure @scope = @scope.parent @@ -1928,6 +1928,10 @@ module ActionDispatch self.class.new hash, self end + def new_level(level) + new(:scope_level => level) + end + def [](key) @hash.fetch(key) { @parent[key] } end -- cgit v1.2.3