aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack
diff options
context:
space:
mode:
authorJosh Kalderimis <josh.kalderimis@gmail.com>2010-11-26 00:21:51 +0100
committerSantiago Pastorino <santiago@wyeworks.com>2010-11-25 21:24:45 -0200
commita98d9d65aef31e3e1c95f59cd65ac7e1cbe76f89 (patch)
treee1538fa8cfaf1f54d47020825db5090b68869cce /actionpack
parent438c0188f8aa07d0e9895a2c13886901ca40ed5e (diff)
downloadrails-a98d9d65aef31e3e1c95f59cd65ac7e1cbe76f89.tar.gz
rails-a98d9d65aef31e3e1c95f59cd65ac7e1cbe76f89.tar.bz2
rails-a98d9d65aef31e3e1c95f59cd65ac7e1cbe76f89.zip
move the setting up of the mime collector into the collector on init
Signed-off-by: Santiago Pastorino <santiago@wyeworks.com>
Diffstat (limited to 'actionpack')
-rw-r--r--actionpack/lib/action_controller/metal/mime_responds.rb6
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)