aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_dispatch
diff options
context:
space:
mode:
Diffstat (limited to 'actionpack/lib/action_dispatch')
-rw-r--r--actionpack/lib/action_dispatch/routing/mapper.rb7
1 files changed, 4 insertions, 3 deletions
diff --git a/actionpack/lib/action_dispatch/routing/mapper.rb b/actionpack/lib/action_dispatch/routing/mapper.rb
index 5182d9e8e1..b54367eceb 100644
--- a/actionpack/lib/action_dispatch/routing/mapper.rb
+++ b/actionpack/lib/action_dispatch/routing/mapper.rb
@@ -305,9 +305,10 @@ module ActionDispatch
def constraints(option_constraints, constraints, path_params)
required_defaults = []
options.each_pair do |key, option|
- constraints[key] = option if Regexp === option
- unless path_params.include?(key) || Regexp === option
- required_defaults << key
+ if Regexp === option
+ constraints[key] = option
+ else
+ required_defaults << key unless path_params.include?(key)
end
end
@conditions[:required_defaults] = required_defaults