aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_controller
diff options
context:
space:
mode:
authorLukasz Strzalkowski <lukaszstrzalkowski@squareup.com>2013-11-10 21:29:53 -0800
committerLukasz Strzalkowski <lukaszstrzalkowski@squareup.com>2013-11-10 21:30:43 -0800
commit83f75a97e27a9ee40887c5eb167036d5b1c05056 (patch)
tree909d78342d12cd62bb36a0d78f1e1fabd259c76e /actionpack/lib/action_controller
parentdbc6ce3d6f2580df41fee4f4a663f5a81943de20 (diff)
downloadrails-83f75a97e27a9ee40887c5eb167036d5b1c05056.tar.gz
rails-83f75a97e27a9ee40887c5eb167036d5b1c05056.tar.bz2
rails-83f75a97e27a9ee40887c5eb167036d5b1c05056.zip
Remove order attribute from collector
Ruby 1.8 legacy. Since 1.9 hash preserves insertion order. No need for additional array to achieve this
Diffstat (limited to 'actionpack/lib/action_controller')
-rw-r--r--actionpack/lib/action_controller/metal/mime_responds.rb7
1 files changed, 3 insertions, 4 deletions
diff --git a/actionpack/lib/action_controller/metal/mime_responds.rb b/actionpack/lib/action_controller/metal/mime_responds.rb
index a072fce1a1..84ade41036 100644
--- a/actionpack/lib/action_controller/metal/mime_responds.rb
+++ b/actionpack/lib/action_controller/metal/mime_responds.rb
@@ -396,10 +396,10 @@ module ActionController #:nodoc:
# request, with this response then being accessible by calling #response.
class Collector
include AbstractController::Collector
- attr_accessor :order, :format
+ attr_accessor :format
def initialize(mimes)
- @order, @responses = [], {}
+ @responses = {}
mimes.each { |mime| send(mime) }
end
@@ -414,7 +414,6 @@ module ActionController #:nodoc:
def custom(mime_type, &block)
mime_type = Mime::Type.lookup(mime_type.to_s) unless mime_type.is_a?(Mime::Type)
- @order << mime_type
@responses[mime_type] ||= block
end
@@ -423,7 +422,7 @@ module ActionController #:nodoc:
end
def negotiate_format(request)
- @format = request.negotiate_mime(order)
+ @format = request.negotiate_mime(@responses.keys)
end
end
end