aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_dispatch
diff options
context:
space:
mode:
authoreileencodes <eileencodes@gmail.com>2016-01-20 10:24:33 -0500
committereileencodes <eileencodes@gmail.com>2016-01-20 10:24:33 -0500
commit4b507dff1e429c65b59cf6c506cdfa3adc44b141 (patch)
tree9fe0dd88382b4305cd45d6f3e6efd64cb3694cf6 /actionpack/lib/action_dispatch
parent6226f8f0662f66c8189f7e628dc42ca59d8f980a (diff)
downloadrails-4b507dff1e429c65b59cf6c506cdfa3adc44b141.tar.gz
rails-4b507dff1e429c65b59cf6c506cdfa3adc44b141.tar.bz2
rails-4b507dff1e429c65b59cf6c506cdfa3adc44b141.zip
Revert "Remove literal? check to fix issue with prefixed optionals"
This reverts commit 5d1b7c3b441654e8008dcd303f5367883ec660a6. The change here didn't actually fix the issue it was trying to fix, and this isn't the correct way to fix either issue. The problem is switching from the builder to grouping with find_all/regex is now very dependent on how you structure your path pattern.
Diffstat (limited to 'actionpack/lib/action_dispatch')
-rw-r--r--actionpack/lib/action_dispatch/routing/mapper.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/actionpack/lib/action_dispatch/routing/mapper.rb b/actionpack/lib/action_dispatch/routing/mapper.rb
index f57d88d1a5..522012063d 100644
--- a/actionpack/lib/action_dispatch/routing/mapper.rb
+++ b/actionpack/lib/action_dispatch/routing/mapper.rb
@@ -187,7 +187,7 @@ module ActionDispatch
# Get all the symbol nodes followed by literals that are not the
# dummy node.
symbols = ast.find_all { |n|
- n.cat? && n.left.symbol? && n.right.cat?
+ n.cat? && n.left.symbol? && n.right.cat? && n.right.left.literal?
}.map(&:left)
# Get all the symbol nodes preceded by literals.