diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2014-12-01 07:55:29 -0800 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2014-12-01 07:55:29 -0800 |
commit | c9a5ed22d518a4c526457302f6a5e8abd152a57f (patch) | |
tree | 4e16ec09cea99e73dfffb57e4174bff64484f327 /actionpack/lib | |
parent | 07786c5e75a7b0afdf318063510af6b475e3e04c (diff) | |
parent | 0d690d75fbb088e967556ea186140ec96b320c42 (diff) | |
download | rails-c9a5ed22d518a4c526457302f6a5e8abd152a57f.tar.gz rails-c9a5ed22d518a4c526457302f6a5e8abd152a57f.tar.bz2 rails-c9a5ed22d518a4c526457302f6a5e8abd152a57f.zip |
Merge pull request #17827 from rkh/rkh-fix-or-pattern
Fix OR in Journey patterns
Diffstat (limited to 'actionpack/lib')
-rw-r--r-- | actionpack/lib/action_dispatch/journey/path/pattern.rb | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/actionpack/lib/action_dispatch/journey/path/pattern.rb b/actionpack/lib/action_dispatch/journey/path/pattern.rb index dca83e806c..64b48ca45f 100644 --- a/actionpack/lib/action_dispatch/journey/path/pattern.rb +++ b/actionpack/lib/action_dispatch/journey/path/pattern.rb @@ -122,6 +122,11 @@ module ActionDispatch re = @matchers[node.left.to_sym] || '.+' "(#{re})" end + + def visit_OR(node) + children = node.children.map { |n| visit n } + "(?:#{children.join(?|)})" + end end class UnanchoredRegexp < AnchoredRegexp # :nodoc: |