aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib
diff options
context:
space:
mode:
authorAaron Patterson <aaron.patterson@gmail.com>2014-08-13 19:24:40 -0700
committerAaron Patterson <aaron.patterson@gmail.com>2014-08-13 19:30:46 -0700
commit19bb6770c0b4a7970a8c6daa2a1ed0f926e721f2 (patch)
tree61612dc0c74b3bb0e85e649f190d1c2948bbe837 /actionpack/lib
parent911ef972a540686fd7fe7a3dee659ce3bb1fd12d (diff)
downloadrails-19bb6770c0b4a7970a8c6daa2a1ed0f926e721f2.tar.gz
rails-19bb6770c0b4a7970a8c6daa2a1ed0f926e721f2.tar.bz2
rails-19bb6770c0b4a7970a8c6daa2a1ed0f926e721f2.zip
move the scope level key fully inside the scope object
Diffstat (limited to 'actionpack/lib')
-rw-r--r--actionpack/lib/action_dispatch/routing/mapper.rb6
1 files changed, 5 insertions, 1 deletions
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