diff options
author | Rafael França <rafaelmfranca@gmail.com> | 2019-04-02 19:32:13 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-04-02 19:32:13 -0400 |
commit | 798f175c65bbfd95b3fa0dd639ca08ae8485d5d1 (patch) | |
tree | 775e8b64f3be1a6c1b8a6ef626fbdf5940c1fc98 /actionpack/lib/action_dispatch/routing | |
parent | 6c6c579a9b72ee676b24a900bebe3e5df161c119 (diff) | |
parent | e09e600a48e525553767da5a1ec2e756fe62aac4 (diff) | |
download | rails-798f175c65bbfd95b3fa0dd639ca08ae8485d5d1.tar.gz rails-798f175c65bbfd95b3fa0dd639ca08ae8485d5d1.tar.bz2 rails-798f175c65bbfd95b3fa0dd639ca08ae8485d5d1.zip |
Merge pull request #24405 from waits/shallow-false
Honor shallow: false on nested resources
Diffstat (limited to 'actionpack/lib/action_dispatch/routing')
-rw-r--r-- | actionpack/lib/action_dispatch/routing/mapper.rb | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/actionpack/lib/action_dispatch/routing/mapper.rb b/actionpack/lib/action_dispatch/routing/mapper.rb index 2d2073de9a..08560ccf7d 100644 --- a/actionpack/lib/action_dispatch/routing/mapper.rb +++ b/actionpack/lib/action_dispatch/routing/mapper.rb @@ -1402,6 +1402,8 @@ module ActionDispatch # as a comment on a blog post like <tt>/posts/a-long-permalink/comments/1234</tt> # to be shortened to just <tt>/comments/1234</tt>. # + # Set shallow: false on a child resource to ignore a parent's shallow parameter. + # # [:shallow_path] # Prefixes nested shallow routes with the specified path. # @@ -1672,7 +1674,8 @@ module ActionDispatch return true end - if options.delete(:shallow) + if options[:shallow] + options.delete(:shallow) shallow do send(method, resources.pop, options, &block) end |