diff options
author | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2012-06-11 10:37:02 -0700 |
---|---|---|
committer | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2012-06-11 10:37:02 -0700 |
commit | 0e97aa2e51f810944162faaae2436313c248f8e8 (patch) | |
tree | 639ffffed6d95316e6428515117a1c1876f9c0b4 /actionpack/lib/action_dispatch/http | |
parent | 5304ae1269266ade678b0a387f9787e3d6b3d477 (diff) | |
parent | c74662a27f642700d3e59482bef6e6bc7e84b5ba (diff) | |
download | rails-0e97aa2e51f810944162faaae2436313c248f8e8.tar.gz rails-0e97aa2e51f810944162faaae2436313c248f8e8.tar.bz2 rails-0e97aa2e51f810944162faaae2436313c248f8e8.zip |
Merge pull request #6705 from ganeshkumar/string_method_changes
both string and symbol will be interpolated as string no need to convert to_s
Diffstat (limited to 'actionpack/lib/action_dispatch/http')
-rw-r--r-- | actionpack/lib/action_dispatch/http/mime_type.rb | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/actionpack/lib/action_dispatch/http/mime_type.rb b/actionpack/lib/action_dispatch/http/mime_type.rb index 0eaae80461..ee1913dbf9 100644 --- a/actionpack/lib/action_dispatch/http/mime_type.rb +++ b/actionpack/lib/action_dispatch/http/mime_type.rb @@ -99,9 +99,9 @@ module Mime end def register(string, symbol, mime_type_synonyms = [], extension_synonyms = [], skip_lookup = false) - Mime.const_set(symbol.to_s.upcase, Type.new(string, symbol, mime_type_synonyms)) + Mime.const_set(symbol.upcase, Type.new(string, symbol, mime_type_synonyms)) - SET << Mime.const_get(symbol.to_s.upcase) + SET << Mime.const_get(symbol.upcase) ([string] + mime_type_synonyms).each { |str| LOOKUP[str] = SET.last } unless skip_lookup ([symbol] + extension_synonyms).each { |ext| EXTENSION_LOOKUP[ext.to_s] = SET.last } @@ -194,7 +194,7 @@ module Mime # # Mime::Type.unregister(:mobile) def unregister(symbol) - symbol = symbol.to_s.upcase + symbol = symbol.upcase mime = Mime.const_get(symbol) Mime.instance_eval { remove_const(symbol) } |