diff options
author | Stefan Henzen <stefan.henzen@gmail.com> | 2014-10-09 15:45:49 +0200 |
---|---|---|
committer | Stefan Henzen <stefan.henzen@gmail.com> | 2014-10-09 15:45:49 +0200 |
commit | e86cadc257caf6dcd762810f022e5d4009c6ca25 (patch) | |
tree | 199e9ba62481118e17a3f139155eaa4f470a6c22 /actionpack/lib | |
parent | 344ec1b6a7ed102ce6a92c31e3b64364f4bdb772 (diff) | |
download | rails-e86cadc257caf6dcd762810f022e5d4009c6ca25.tar.gz rails-e86cadc257caf6dcd762810f022e5d4009c6ca25.tar.bz2 rails-e86cadc257caf6dcd762810f022e5d4009c6ca25.zip |
Request#check_method no longer breaks when :en is not available locale
Request#check_method would use to_sentence(locale: :en), which breaks when
I18n.available_locales does not include :en and
I18n.enforce_available_locales is true (default).
Inlined to_sentence functionality to solve this.
Diffstat (limited to 'actionpack/lib')
-rw-r--r-- | actionpack/lib/action_dispatch/http/request.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/actionpack/lib/action_dispatch/http/request.rb b/actionpack/lib/action_dispatch/http/request.rb index e854dd266c..a8785ee6bf 100644 --- a/actionpack/lib/action_dispatch/http/request.rb +++ b/actionpack/lib/action_dispatch/http/request.rb @@ -341,7 +341,7 @@ module ActionDispatch private def check_method(name) - HTTP_METHOD_LOOKUP[name] || raise(ActionController::UnknownHttpMethod, "#{name}, accepted HTTP methods are #{HTTP_METHODS.to_sentence(:locale => :en)}") + HTTP_METHOD_LOOKUP[name] || raise(ActionController::UnknownHttpMethod, "#{name}, accepted HTTP methods are #{HTTP_METHODS[0...-1].join(', ')}, and #{HTTP_METHODS[-1]}") name end end |