diff options
Diffstat (limited to 'actionpack/lib/action_dispatch/routing/mapper.rb')
-rw-r--r-- | actionpack/lib/action_dispatch/routing/mapper.rb | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/actionpack/lib/action_dispatch/routing/mapper.rb b/actionpack/lib/action_dispatch/routing/mapper.rb index 05cbcf709e..df4c95d909 100644 --- a/actionpack/lib/action_dispatch/routing/mapper.rb +++ b/actionpack/lib/action_dispatch/routing/mapper.rb @@ -641,19 +641,16 @@ module ActionDispatch # resources :posts # end def scope(*args) - options = args.extract_options! - options = options.dup - - options[:path] = args.flatten.join('/') if args.any? + options = args.extract_options!.dup recover = {} + options[:path] = args.flatten.join('/') if args.any? options[:constraints] ||= {} - unless options[:constraints].is_a?(Hash) - block, options[:constraints] = options[:constraints], {} - end if options[:constraints].is_a?(Hash) (options[:defaults] ||= {}).reverse_merge!(defaults_from_constraints(options[:constraints])) + else + block, options[:constraints] = options[:constraints], {} end scope_options.each do |option| |