always make :via a list

This commit is contained in:
Aaron Patterson 2014-05-30 11:12:57 -07:00
parent 6a3cbaca2e
commit 2c32e94b89

@ -213,12 +213,11 @@ def normalize_conditions!(path_params, path, ast)
end end
@conditions[:required_defaults] = required_defaults @conditions[:required_defaults] = required_defaults
via = options[:via] via = Array(options[:via]).compact
if via == :all if via == [:all]
options.delete(:via) options.delete(:via)
else else
via = Array(via).compact
if via.empty? if via.empty?
msg = "You should not use the `match` method in your router without specifying an HTTP method.\n" \ 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" \ "If you want to expose your action to both GET and POST, add `via: [:get, :post]` option.\n" \