diff options
author | Neeraj Singh <neerajdotname@gmail.com> | 2010-11-22 13:55:43 -0500 |
---|---|---|
committer | José Valim <jose.valim@gmail.com> | 2010-11-22 23:06:15 +0100 |
commit | 794b34306eea0c7e1e99f5741df16129e8e22b3f (patch) | |
tree | e4e4999ef6bdc55077f970b7b50e3b4a7c6ad052 /actionpack/lib | |
parent | c5bfc6abe4fd160814f09b02afe68d7f4e25e3d6 (diff) | |
download | rails-794b34306eea0c7e1e99f5741df16129e8e22b3f.tar.gz rails-794b34306eea0c7e1e99f5741df16129e8e22b3f.tar.bz2 rails-794b34306eea0c7e1e99f5741df16129e8e22b3f.zip |
remove select, collect and then inject with
something better
Signed-off-by: José Valim <jose.valim@gmail.com>
Diffstat (limited to 'actionpack/lib')
-rw-r--r-- | actionpack/lib/action_dispatch/http/mime_type.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/actionpack/lib/action_dispatch/http/mime_type.rb b/actionpack/lib/action_dispatch/http/mime_type.rb index af7b62b863..2250cfa88a 100644 --- a/actionpack/lib/action_dispatch/http/mime_type.rb +++ b/actionpack/lib/action_dispatch/http/mime_type.rb @@ -175,7 +175,7 @@ module Mime # returend value: [Mime::HTML, Mime::JS, Mime::XML, Mime::YAML, Mime::ATOM, Mime::JSON, Mime::RSS, Mime::URL_ENCODED_FORM def parse_data_with_trailing_star(input) keys = Mime::LOOKUP.keys.select{|k| k.include?(input)} - Mime::LOOKUP.select {|k,_| keys.include?(k)}.collect{|i| i[1]}.inject([]){|all,e| all.include?(e) ? all : all << e} + Mime::LOOKUP.values_at(*keys).uniq end end |