diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2013-01-25 10:39:23 -0800 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2013-01-30 10:24:58 -0800 |
commit | c337e8707cd404ff2d8a69a6fd90b81cd7f7684b (patch) | |
tree | a43f9fbfed625bdab184581e7428006bedd20157 | |
parent | 8e5b4372d088e933b5f64c400e299fc9c7a6967c (diff) | |
download | rails-c337e8707cd404ff2d8a69a6fd90b81cd7f7684b.tar.gz rails-c337e8707cd404ff2d8a69a6fd90b81cd7f7684b.tar.bz2 rails-c337e8707cd404ff2d8a69a6fd90b81cd7f7684b.zip |
cache path parts in the instance
-rw-r--r-- | actionpack/lib/action_dispatch/routing/route_set.rb | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/actionpack/lib/action_dispatch/routing/route_set.rb b/actionpack/lib/action_dispatch/routing/route_set.rb index eae3e35ba1..2bf732ac26 100644 --- a/actionpack/lib/action_dispatch/routing/route_set.rb +++ b/actionpack/lib/action_dispatch/routing/route_set.rb @@ -163,7 +163,8 @@ module ActionDispatch def initialize(route, options) super - @arg_size = @route.required_parts.size + @path_parts = @route.required_parts + @arg_size = @path_parts.size end def call(t, args) @@ -185,7 +186,7 @@ module ActionDispatch true end - @route.required_parts.each_with_index do |part, i| + @path_parts.each_with_index do |part, i| # Replace each route parameter # e.g. :id for regular parameter or *path for globbing # with ruby string interpolation code |