diff options
author | Andrew White <andyw@pixeltrix.co.uk> | 2010-06-19 20:52:55 +0100 |
---|---|---|
committer | José Valim <jose.valim@gmail.com> | 2010-06-20 00:15:30 +0200 |
commit | 65ce3d12971afd15de6ea22a2fc5af3ba1faf124 (patch) | |
tree | 4337c87564b7a3d5aa7fbaa30271b02966b6b58d /actionpack/lib | |
parent | 72725d7b7fefa1231cf63bddf8faa48a44f71295 (diff) | |
download | rails-65ce3d12971afd15de6ea22a2fc5af3ba1faf124.tar.gz rails-65ce3d12971afd15de6ea22a2fc5af3ba1faf124.tar.bz2 rails-65ce3d12971afd15de6ea22a2fc5af3ba1faf124.zip |
Accept an object for :constraints option [#4904 state:resolved]
Signed-off-by: José Valim <jose.valim@gmail.com>
Diffstat (limited to 'actionpack/lib')
-rw-r--r-- | actionpack/lib/action_dispatch/routing/mapper.rb | 2 |
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 0018b6485b..5d6147c48a 100644 --- a/actionpack/lib/action_dispatch/routing/mapper.rb +++ b/actionpack/lib/action_dispatch/routing/mapper.rb @@ -102,7 +102,7 @@ module ActionDispatch end def requirements - @requirements ||= (@options[:constraints] || {}).tap do |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) } end |