diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2015-08-10 17:57:06 -0700 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2015-08-10 17:57:17 -0700 |
commit | 8adf25a6323ad20302d7009d482ec01491ec92eb (patch) | |
tree | 9df63dc37a0133c5f02378e495933187ae5ea75d | |
parent | 7f3cfb606730965be690859a49236cf581fd469b (diff) | |
download | rails-8adf25a6323ad20302d7009d482ec01491ec92eb.tar.gz rails-8adf25a6323ad20302d7009d482ec01491ec92eb.tar.bz2 rails-8adf25a6323ad20302d7009d482ec01491ec92eb.zip |
try to pass fewer options to `scope`
We already know how to handle `path`, so lets just handle it on our own.
-rw-r--r-- | actionpack/lib/action_dispatch/routing/mapper.rb | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/actionpack/lib/action_dispatch/routing/mapper.rb b/actionpack/lib/action_dispatch/routing/mapper.rb index c51be5d29f..dc400b77c9 100644 --- a/actionpack/lib/action_dispatch/routing/mapper.rb +++ b/actionpack/lib/action_dispatch/routing/mapper.rb @@ -876,13 +876,14 @@ module ActionDispatch defaults = { module: path, - path: options.fetch(:path, path), as: options.fetch(:as, path), shallow_path: options.fetch(:path, path), shallow_prefix: options.fetch(:as, path) } - scope(defaults.merge!(options)) { yield } + path_scope(options.delete(:path) || path) do + scope(defaults.merge!(options)) { yield } + end end # === Parameter Restriction |