diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2012-01-23 17:14:47 -0800 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2012-01-23 17:14:47 -0800 |
commit | dea2523232a0b2f9e7ba0b1d271aff4584a4e2a3 (patch) | |
tree | 01a3639cd5b37fba5839e480b354dc93db995448 /actionpack/lib | |
parent | 8d26f875f70beef3062deb5ded9c5ffcd473d5ac (diff) | |
download | rails-dea2523232a0b2f9e7ba0b1d271aff4584a4e2a3.tar.gz rails-dea2523232a0b2f9e7ba0b1d271aff4584a4e2a3.tar.bz2 rails-dea2523232a0b2f9e7ba0b1d271aff4584a4e2a3.zip |
initialized the @segment_keys instance variable
Diffstat (limited to 'actionpack/lib')
-rw-r--r-- | actionpack/lib/action_dispatch/routing/mapper.rb | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/actionpack/lib/action_dispatch/routing/mapper.rb b/actionpack/lib/action_dispatch/routing/mapper.rb index 20077befca..e2d7a29079 100644 --- a/actionpack/lib/action_dispatch/routing/mapper.rb +++ b/actionpack/lib/action_dispatch/routing/mapper.rb @@ -55,6 +55,7 @@ module ActionDispatch def initialize(set, scope, path, options) @set, @scope = set, scope + @segment_keys = nil @options = (@scope[:options] || {}).merge(options) @path = normalize_path(path) normalize_options! @@ -214,7 +215,9 @@ module ActionDispatch end def segment_keys - @segment_keys ||= Journey::Path::Pattern.new( + return @segment_keys if @segment_keys + + @segment_keys = Journey::Path::Pattern.new( Journey::Router::Strexp.compile(@path, requirements, SEPARATORS) ).names end |