diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2014-08-13 19:29:24 -0700 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2014-08-13 19:30:47 -0700 |
commit | 677bc212eb7f35ad0f8808f56450a4b6b2340023 (patch) | |
tree | 1e150e6b6512935adaebf08d6f1879d0814bed88 | |
parent | 19bb6770c0b4a7970a8c6daa2a1ed0f926e721f2 (diff) | |
download | rails-677bc212eb7f35ad0f8808f56450a4b6b2340023.tar.gz rails-677bc212eb7f35ad0f8808f56450a4b6b2340023.tar.bz2 rails-677bc212eb7f35ad0f8808f56450a4b6b2340023.zip |
scope_level is no longer a hash key, just use the ivar
-rw-r--r-- | actionpack/lib/action_dispatch/routing/mapper.rb | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/actionpack/lib/action_dispatch/routing/mapper.rb b/actionpack/lib/action_dispatch/routing/mapper.rb index 9c9c56fbce..fa273ac201 100644 --- a/actionpack/lib/action_dispatch/routing/mapper.rb +++ b/actionpack/lib/action_dispatch/routing/mapper.rb @@ -1903,13 +1903,14 @@ module ActionDispatch attr_reader :parent - def initialize(hash, parent = {}) + def initialize(hash, parent = {}, scope_level = nil) @hash = hash @parent = parent + @scope_level = scope_level end def scope_level - self[:scope_level] + @scope_level end def nested? @@ -1925,11 +1926,15 @@ module ActionDispatch end def new(hash) - self.class.new hash, self + self.class.new hash, self, scope_level end def new_level(level) - new(:scope_level => level) + self.class.new(self, self, level) + end + + def fetch(key, &block) + @hash.fetch(key, &block) end def [](key) |