Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

scope_level is no longer a hash key, just use the ivar

  • Loading branch information...
commit 677bc212eb7f35ad0f8808f56450a4b6b2340023 1 parent 19bb677
@tenderlove tenderlove authored
Showing with 9 additions and 4 deletions.
  1. +9 −4 actionpack/lib/action_dispatch/routing/mapper.rb
View
13 actionpack/lib/action_dispatch/routing/mapper.rb
@@ -1903,13 +1903,14 @@ class Scope # :nodoc:
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 @@ def options
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)
Please sign in to comment.
Something went wrong with that request. Please try again.