From dbf42e379becc5612a0efe3476a999a9d6d803f0 Mon Sep 17 00:00:00 2001 From: Jeremy Kemper Date: Tue, 6 Mar 2007 09:46:04 +0000 Subject: Prefer MIME constants to strings. Closes #7707. git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6350 5ecf4fe2-1ee6-0310-87b1-e25e094e27de --- actionpack/lib/action_controller/mime_type.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'actionpack/lib/action_controller/mime_type.rb') diff --git a/actionpack/lib/action_controller/mime_type.rb b/actionpack/lib/action_controller/mime_type.rb index 17b3d861ec..b179fe2f89 100644 --- a/actionpack/lib/action_controller/mime_type.rb +++ b/actionpack/lib/action_controller/mime_type.rb @@ -24,7 +24,7 @@ module Mime def initialize(order, name, q=nil) @order = order @name = name.strip - q ||= 0.0 if @name == "*/*" # default "*/*" to end of list + q ||= 0.0 if @name == Mime::ALL # default wilcard match to end of list @q = ((q || 1.0).to_f * 100).to_i end @@ -70,7 +70,7 @@ module Mime # Take care of the broken text/xml entry by renaming or deleting it text_xml = list.index("text/xml") - app_xml = list.index("application/xml") + app_xml = list.index(Mime::XML.to_s) if text_xml && app_xml # set the q value to the max of the two @@ -84,9 +84,9 @@ module Mime # delete text_xml from the list list.delete_at(text_xml) - + elsif text_xml - list[text_xml].name = "application/xml" + list[text_xml].name = Mime::XML.to_s end # Look for more specific xml-based types and sort them ahead of app/xml -- cgit v1.2.3