diff options
author | Lukasz Strzalkowski <lukaszstrzalkowski@squareup.com> | 2013-11-10 21:29:53 -0800 |
---|---|---|
committer | Lukasz Strzalkowski <lukaszstrzalkowski@squareup.com> | 2013-11-10 21:30:43 -0800 |
commit | 83f75a97e27a9ee40887c5eb167036d5b1c05056 (patch) | |
tree | 909d78342d12cd62bb36a0d78f1e1fabd259c76e /actionpack/lib/action_controller | |
parent | dbc6ce3d6f2580df41fee4f4a663f5a81943de20 (diff) | |
download | rails-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.rb | 7 |
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 |