aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAaron Patterson <aaron.patterson@gmail.com>2015-08-10 17:57:06 -0700
committerAaron Patterson <aaron.patterson@gmail.com>2015-08-10 17:57:17 -0700
commit8adf25a6323ad20302d7009d482ec01491ec92eb (patch)
tree9df63dc37a0133c5f02378e495933187ae5ea75d
parent7f3cfb606730965be690859a49236cf581fd469b (diff)
downloadrails-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.rb5
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