diff options
author | Josh Kalderimis <josh.kalderimis@gmail.com> | 2010-11-26 00:21:51 +0100 |
---|---|---|
committer | Josh Kalderimis <josh.kalderimis@gmail.com> | 2010-11-26 00:21:51 +0100 |
commit | 2c08ee97c78b7eb0883f1b0347c69a088c109388 (patch) | |
tree | e1538fa8cfaf1f54d47020825db5090b68869cce /actionpack/lib | |
parent | 438c0188f8aa07d0e9895a2c13886901ca40ed5e (diff) | |
download | rails-2c08ee97c78b7eb0883f1b0347c69a088c109388.tar.gz rails-2c08ee97c78b7eb0883f1b0347c69a088c109388.tar.bz2 rails-2c08ee97c78b7eb0883f1b0347c69a088c109388.zip |
move the setting up of the mime collector into the collector on init
Diffstat (limited to 'actionpack/lib')
-rw-r--r-- | actionpack/lib/action_controller/metal/mime_responds.rb | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/actionpack/lib/action_controller/metal/mime_responds.rb b/actionpack/lib/action_controller/metal/mime_responds.rb index 6fe1f4ece5..2e58155b7c 100644 --- a/actionpack/lib/action_controller/metal/mime_responds.rb +++ b/actionpack/lib/action_controller/metal/mime_responds.rb @@ -258,9 +258,8 @@ module ActionController #:nodoc: # nil if :not_acceptable was sent to the client. # def retrieve_response_from_mimes(mimes=nil, &block) - collector = Collector.new { default_render } mimes ||= collect_mimes_from_class_level - mimes.each { |mime| collector.send(mime) } + collector = Collector.new(mimes) { default_render } block.call(collector) if block_given? if format = request.negotiate_mime(collector.order) @@ -277,8 +276,9 @@ module ActionController #:nodoc: include AbstractController::Collector attr_accessor :order - def initialize(&block) + def initialize(mimes, &block) @order, @responses, @default_response = [], {}, block + mimes.each { |mime| self.send(mime) } end def any(*args, &block) |