diff options
Diffstat (limited to 'actionpack/lib/action_dispatch/routing/mapper.rb')
-rw-r--r-- | actionpack/lib/action_dispatch/routing/mapper.rb | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/actionpack/lib/action_dispatch/routing/mapper.rb b/actionpack/lib/action_dispatch/routing/mapper.rb index cee3fd880c..f52fb91e97 100644 --- a/actionpack/lib/action_dispatch/routing/mapper.rb +++ b/actionpack/lib/action_dispatch/routing/mapper.rb @@ -611,9 +611,18 @@ module ActionDispatch end def actions - if only = @options[:only] + only, except = @options.values_at(:only, :except) + if only == :all || except == :none + only = nil + except = [] + elsif only == :none || except == :all + only = [] + except = nil + end + + if only Array(only).map(&:to_sym) - elsif except = @options[:except] + elsif except default_actions - Array(except).map(&:to_sym) else default_actions |