aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib
diff options
context:
space:
mode:
authorMaura Fitzgerald <momochanfitz@gmail.com>2012-11-02 23:19:05 +0000
committerAndrew White <andyw@pixeltrix.co.uk>2012-12-04 14:42:09 +0000
commit4243de6a04559dd5f02618b46f9f183e4e76a552 (patch)
tree2a02b24c47a203e8812f0ee1db38ff1f7ce487d2 /actionpack/lib
parenta9dc44677ca0caa3660a54b191dca5229dc25f4f (diff)
downloadrails-4243de6a04559dd5f02618b46f9f183e4e76a552.tar.gz
rails-4243de6a04559dd5f02618b46f9f183e4e76a552.tar.bz2
rails-4243de6a04559dd5f02618b46f9f183e4e76a552.zip
Fixed issue where routes with globs caused constraints on that glob to
be ignored. A regular expression constraint gets overwritten when the routes.rb file is processed. Changed the overwriting to an ||= instead of an = assignment.
Diffstat (limited to 'actionpack/lib')
-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 0c19b493ab..a3a8a1b509 100644
--- a/actionpack/lib/action_dispatch/routing/mapper.rb
+++ b/actionpack/lib/action_dispatch/routing/mapper.rb
@@ -158,7 +158,7 @@ module ActionDispatch
def requirements
@requirements ||= (@options[:constraints].is_a?(Hash) ? @options[:constraints] : {}).tap do |requirements|
requirements.reverse_merge!(@scope[:constraints]) if @scope[:constraints]
- @options.each { |k, v| requirements[k] = v if v.is_a?(Regexp) }
+ @options.each { |k, v| requirements[k] ||= v if v.is_a?(Regexp) }
end
end