Permalink
Browse files

Merge pull request #12838 from strzalek/remove_mime_type_order_var

Remove @order attribute from collector
  • Loading branch information...
2 parents 4a344c5 + 83f75a9 commit b72304f41ed33c266189973c7e8869124fbc2130 @guilleiguaran guilleiguaran committed Nov 11, 2013
Showing with 3 additions and 4 deletions.
  1. +3 −4 actionpack/lib/action_controller/metal/mime_responds.rb
@@ -396,10 +396,10 @@ def retrieve_collector_from_mimes(mimes=nil, &block) #: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 @@ def any(*args, &block)
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 @@ def response
end
def negotiate_format(request)
- @format = request.negotiate_mime(order)
+ @format = request.negotiate_mime(@responses.keys)
end
end
end

0 comments on commit b72304f

Please sign in to comment.