Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

always make :via a list

  • Loading branch information...
commit 2c32e94b892c873bd62d13db31ace75d59e8b576 1 parent 6a3cbac
@tenderlove tenderlove authored
Showing with 2 additions and 3 deletions.
  1. +2 −3 actionpack/lib/action_dispatch/routing/mapper.rb
View
5 actionpack/lib/action_dispatch/routing/mapper.rb
@@ -213,12 +213,11 @@ def normalize_conditions!(path_params, path, ast)
end
@conditions[:required_defaults] = required_defaults
- via = options[:via]
+ via = Array(options[:via]).compact
- if via == :all
+ if via == [:all]
options.delete(:via)
else
- via = Array(via).compact
if via.empty?
msg = "You should not use the `match` method in your router without specifying an HTTP method.\n" \
"If you want to expose your action to both GET and POST, add `via: [:get, :post]` option.\n" \
Please sign in to comment.
Something went wrong with that request. Please try again.