From a09e99259c688a839bd5b4635da6f119dd1e0e41 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Valim?= Date: Sat, 27 Mar 2010 20:51:25 +0100 Subject: Ensure details are frozen after @details_keys lookup. The implementation waits to freeze until the last required moment, to avoid duping hashes. --- actionmailer/lib/action_mailer/base.rb | 2 +- actionmailer/lib/action_mailer/collector.rb | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) (limited to 'actionmailer/lib') diff --git a/actionmailer/lib/action_mailer/base.rb b/actionmailer/lib/action_mailer/base.rb index 1dc2d92c43..0519783d02 100644 --- a/actionmailer/lib/action_mailer/base.rb +++ b/actionmailer/lib/action_mailer/base.rb @@ -591,7 +591,7 @@ module ActionMailer #:nodoc: responses, parts_order = [], nil if block_given? - collector = ActionMailer::Collector.new(self) { render(action_name) } + collector = ActionMailer::Collector.new(lookup_context) { render(action_name) } yield(collector) parts_order = collector.responses.map { |r| r[:content_type] } responses = collector.responses diff --git a/actionmailer/lib/action_mailer/collector.rb b/actionmailer/lib/action_mailer/collector.rb index bd4f76bbb6..d03e085e83 100644 --- a/actionmailer/lib/action_mailer/collector.rb +++ b/actionmailer/lib/action_mailer/collector.rb @@ -22,8 +22,7 @@ module ActionMailer #:nodoc: def custom(mime, options={}) options.reverse_merge!(:content_type => mime.to_s) - @context.formats = [mime.to_sym] - @context.formats.freeze + @context.freeze_formats([mime.to_sym]) options[:body] = block_given? ? yield : @default_render.call @responses << options end -- cgit v1.2.3