aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_dispatch
diff options
context:
space:
mode:
authorAndrew White <andyw@pixeltrix.co.uk>2010-08-18 11:50:15 +0100
committerJosé Valim <jose.valim@gmail.com>2010-08-19 15:05:57 -0300
commitc019db8ca1c5639fdae80915cc7520eaad7dcd65 (patch)
treebc1006d0e19e326a7898be207ec9f5b87cf72f90 /actionpack/lib/action_dispatch
parent0cc483aa14d79b2d07fdc71dbd935d1af8361d71 (diff)
downloadrails-c019db8ca1c5639fdae80915cc7520eaad7dcd65.tar.gz
rails-c019db8ca1c5639fdae80915cc7520eaad7dcd65.tar.bz2
rails-c019db8ca1c5639fdae80915cc7520eaad7dcd65.zip
Move regexps in options hash to :constraints hash so that they are pushed into the scope [#5208 state:resolved]
Signed-off-by: José Valim <jose.valim@gmail.com>
Diffstat (limited to 'actionpack/lib/action_dispatch')
-rw-r--r--actionpack/lib/action_dispatch/routing/mapper.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/actionpack/lib/action_dispatch/routing/mapper.rb b/actionpack/lib/action_dispatch/routing/mapper.rb
index 26ca2ca818..b9e097e5d1 100644
--- a/actionpack/lib/action_dispatch/routing/mapper.rb
+++ b/actionpack/lib/action_dispatch/routing/mapper.rb
@@ -774,6 +774,10 @@ module ActionDispatch
return true
end
+ options.each do |k,v|
+ (options[:constraints] ||= {})[k] = options.delete(k) if options[k].is_a?(Regexp)
+ end
+
scope_options = options.slice!(*RESOURCE_OPTIONS)
unless scope_options.empty?
scope(scope_options) do