diff options
author | Andrew White <andyw@pixeltrix.co.uk> | 2014-03-08 19:49:11 +0000 |
---|---|---|
committer | Andrew White <andyw@pixeltrix.co.uk> | 2014-03-08 19:51:06 +0000 |
commit | af4c9b78ff1c967cc1aaef14d34205ef92db8134 (patch) | |
tree | 5cde700b701874b8e6fa0acefa94cfbf7dccf97b /actionpack/lib | |
parent | 8711086f5a2e73cd068434a5fafef258ba9f4fe1 (diff) | |
download | rails-af4c9b78ff1c967cc1aaef14d34205ef92db8134.tar.gz rails-af4c9b78ff1c967cc1aaef14d34205ef92db8134.tar.bz2 rails-af4c9b78ff1c967cc1aaef14d34205ef92db8134.zip |
Copy shallow options from normal options when using scope
If the options :shallow_prefix and :shallow_path are not set in the
scope options then copy them from the normal :as and :path options
if they are set.
Diffstat (limited to 'actionpack/lib')
-rw-r--r-- | actionpack/lib/action_dispatch/routing/mapper.rb | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/actionpack/lib/action_dispatch/routing/mapper.rb b/actionpack/lib/action_dispatch/routing/mapper.rb index 1ad419ec80..357829e59f 100644 --- a/actionpack/lib/action_dispatch/routing/mapper.rb +++ b/actionpack/lib/action_dispatch/routing/mapper.rb @@ -708,7 +708,8 @@ module ActionDispatch options[:constraints] ||= {} unless shallow? - options[:shallow_path] = options[:path] if args.any? + options[:shallow_path] ||= options[:path] if options.key?(:path) + options[:shallow_prefix] ||= options[:as] if options.key?(:as) end if options[:constraints].is_a?(Hash) |