diff options
Diffstat (limited to 'actionpack/lib/action_dispatch/journey')
-rw-r--r-- | actionpack/lib/action_dispatch/journey/route.rb | 2 | ||||
-rw-r--r-- | actionpack/lib/action_dispatch/journey/routes.rb | 4 |
2 files changed, 5 insertions, 1 deletions
diff --git a/actionpack/lib/action_dispatch/journey/route.rb b/actionpack/lib/action_dispatch/journey/route.rb index 4d5c18984a..4698ff8cc7 100644 --- a/actionpack/lib/action_dispatch/journey/route.rb +++ b/actionpack/lib/action_dispatch/journey/route.rb @@ -36,7 +36,7 @@ module ActionDispatch def requirements # :nodoc: # needed for rails `rake routes` - path.requirements.merge(@defaults).delete_if { |_,v| + @defaults.merge(path.requirements).delete_if { |_,v| /.+?/ == v } end diff --git a/actionpack/lib/action_dispatch/journey/routes.rb b/actionpack/lib/action_dispatch/journey/routes.rb index a6d1980db2..6325dfa3dd 100644 --- a/actionpack/lib/action_dispatch/journey/routes.rb +++ b/actionpack/lib/action_dispatch/journey/routes.rb @@ -16,6 +16,10 @@ module ActionDispatch @simulator = nil end + def empty? + routes.empty? + end + def length routes.length end |