diff options
author | Yehuda Katz <wycats@yehuda-katz.home> | 2009-12-20 18:50:47 -0800 |
---|---|---|
committer | Yehuda Katz <wycats@yehuda-katz.home> | 2009-12-20 18:50:54 -0800 |
commit | 17f66473bce0decb2e5ff23142d4046056ccca1b (patch) | |
tree | 3e40db99f5f0aa5f216697b768da364706c33d83 /actionpack/lib/action_dispatch/http | |
parent | eeda059818ae95620a7c7b86ad0ff2fa621cbe88 (diff) | |
download | rails-17f66473bce0decb2e5ff23142d4046056ccca1b.tar.gz rails-17f66473bce0decb2e5ff23142d4046056ccca1b.tar.bz2 rails-17f66473bce0decb2e5ff23142d4046056ccca1b.zip |
AC::Head now doesn't have an unfulfilled Rendering dependency, and instead works just fine standalone (which means that ConditionalGet also doesn't have a Rendering dependency)
Diffstat (limited to 'actionpack/lib/action_dispatch/http')
-rw-r--r-- | actionpack/lib/action_dispatch/http/response.rb | 2 | ||||
-rw-r--r-- | actionpack/lib/action_dispatch/http/status_codes.rb | 8 |
2 files changed, 9 insertions, 1 deletions
diff --git a/actionpack/lib/action_dispatch/http/response.rb b/actionpack/lib/action_dispatch/http/response.rb index 6e63fc0067..6dc563264f 100644 --- a/actionpack/lib/action_dispatch/http/response.rb +++ b/actionpack/lib/action_dispatch/http/response.rb @@ -60,7 +60,7 @@ module ActionDispatch # :nodoc: end def status=(status) - @status = status.to_i + @status = ActionDispatch::StatusCodes[status] end # The response code of the request diff --git a/actionpack/lib/action_dispatch/http/status_codes.rb b/actionpack/lib/action_dispatch/http/status_codes.rb index ea1475e827..3d6ee685ea 100644 --- a/actionpack/lib/action_dispatch/http/status_codes.rb +++ b/actionpack/lib/action_dispatch/http/status_codes.rb @@ -14,6 +14,14 @@ module ActionDispatch 510 => "Not Extended" }).freeze + def self.[](status) + if status.is_a?(Symbol) + SYMBOL_TO_STATUS_CODE[status] || 500 + else + status.to_i + end + end + # Provides a symbol-to-fixnum lookup for converting a symbol (like # :created or :not_implemented) into its corresponding HTTP status # code (like 200 or 501). |