aboutsummaryrefslogtreecommitdiffstats
path: root/actionmailer/lib
diff options
context:
space:
mode:
authorJosé Valim <jose.valim@gmail.com>2010-03-27 20:51:25 +0100
committerJosé Valim <jose.valim@gmail.com>2010-03-27 20:52:11 +0100
commita09e99259c688a839bd5b4635da6f119dd1e0e41 (patch)
tree9e1399562185082853aacc837211f837f7a5a231 /actionmailer/lib
parentfdebc7f55bdd9730216ac1f00880838ae0db90bd (diff)
downloadrails-a09e99259c688a839bd5b4635da6f119dd1e0e41.tar.gz
rails-a09e99259c688a839bd5b4635da6f119dd1e0e41.tar.bz2
rails-a09e99259c688a839bd5b4635da6f119dd1e0e41.zip
Ensure details are frozen after @details_keys lookup. The implementation waits to freeze until the last required moment, to avoid duping hashes.
Diffstat (limited to 'actionmailer/lib')
-rw-r--r--actionmailer/lib/action_mailer/base.rb2
-rw-r--r--actionmailer/lib/action_mailer/collector.rb3
2 files changed, 2 insertions, 3 deletions
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