Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

only do Regexp === option once

  • Loading branch information...
commit 981029b3ffdeaae8d70640cbf1bd4884eca7e51b 1 parent 404feeb
@tenderlove tenderlove authored
Showing with 4 additions and 3 deletions.
  1. +4 −3 actionpack/lib/action_dispatch/routing/mapper.rb
View
7 actionpack/lib/action_dispatch/routing/mapper.rb
@@ -305,9 +305,10 @@ def blocks(options_constraints, scope_blocks)
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
Please sign in to comment.
Something went wrong with that request. Please try again.