diff options
author | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2018-11-19 19:06:40 -0500 |
---|---|---|
committer | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2018-11-19 19:06:40 -0500 |
commit | 4aad2e2228b2127680e6b5aaba5c0cf0e09b1467 (patch) | |
tree | a8f0e436b5b7ea11aa2c2188d7ccd05f10b8908a /actionpack/lib/action_dispatch | |
parent | 0bbe3409b52d6f7c29a29fbcb9e1acf9d3822406 (diff) | |
parent | 0c8dd2cab6793973384f7320c2cb2b832ec38aff (diff) | |
download | rails-4aad2e2228b2127680e6b5aaba5c0cf0e09b1467.tar.gz rails-4aad2e2228b2127680e6b5aaba5c0cf0e09b1467.tar.bz2 rails-4aad2e2228b2127680e6b5aaba5c0cf0e09b1467.zip |
Merge pull request #20865 from colavitam/only-except-behavior
:only and :except are now chained for routing resource(s)
Diffstat (limited to 'actionpack/lib/action_dispatch')
-rw-r--r-- | actionpack/lib/action_dispatch/routing/mapper.rb | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/actionpack/lib/action_dispatch/routing/mapper.rb b/actionpack/lib/action_dispatch/routing/mapper.rb index 99f3b4c2cd..06ce165f76 100644 --- a/actionpack/lib/action_dispatch/routing/mapper.rb +++ b/actionpack/lib/action_dispatch/routing/mapper.rb @@ -1171,10 +1171,16 @@ module ActionDispatch end def actions + if @except + available_actions - Array(@except).map(&:to_sym) + else + available_actions + end + end + + def available_actions if @only Array(@only).map(&:to_sym) - elsif @except - default_actions - Array(@except).map(&:to_sym) else default_actions end |