aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_dispatch
diff options
context:
space:
mode:
authorJeremy Kemper <jeremy@bitsweat.net>2009-05-13 16:15:37 -0700
committerJeremy Kemper <jeremy@bitsweat.net>2009-05-14 02:01:08 -0700
commit5dd29c466c38a1bc395da579fd4b22c5e5a8e9fd (patch)
tree8a6d7221b7e203ce6a717196509a11930b8f1823 /actionpack/lib/action_dispatch
parent29bd8f7b8975bc0442f0b63e7da077f9a3f22dc6 (diff)
downloadrails-5dd29c466c38a1bc395da579fd4b22c5e5a8e9fd.tar.gz
rails-5dd29c466c38a1bc395da579fd4b22c5e5a8e9fd.tar.bz2
rails-5dd29c466c38a1bc395da579fd4b22c5e5a8e9fd.zip
Cherry-picking Active Support extensions
Diffstat (limited to 'actionpack/lib/action_dispatch')
-rw-r--r--actionpack/lib/action_dispatch/http/status_codes.rb6
1 files changed, 4 insertions, 2 deletions
diff --git a/actionpack/lib/action_dispatch/http/status_codes.rb b/actionpack/lib/action_dispatch/http/status_codes.rb
index 830de2a6db..5bac842ec1 100644
--- a/actionpack/lib/action_dispatch/http/status_codes.rb
+++ b/actionpack/lib/action_dispatch/http/status_codes.rb
@@ -1,3 +1,5 @@
+require 'active_support/inflector'
+
module ActionDispatch
module StatusCodes #:nodoc:
STATUS_CODES = Rack::Utils::HTTP_STATUS_CODES.merge({
@@ -16,7 +18,7 @@ module ActionDispatch
# :created or :not_implemented) into its corresponding HTTP status
# code (like 200 or 501).
SYMBOL_TO_STATUS_CODE = STATUS_CODES.inject({}) { |hash, (code, message)|
- hash[message.gsub(/ /, "").underscore.to_sym] = code
+ hash[ActiveSupport::Inflector.underscore(message.gsub(/ /, "")).to_sym] = code
hash
}.freeze
@@ -37,4 +39,4 @@ module ActionDispatch
end
end
end
-end \ No newline at end of file
+end