aboutsummaryrefslogtreecommitdiffstats
path: root/actionmailer/lib/action_mailer/collector.rb
diff options
context:
space:
mode:
Diffstat (limited to 'actionmailer/lib/action_mailer/collector.rb')
-rw-r--r--actionmailer/lib/action_mailer/collector.rb11
1 files changed, 3 insertions, 8 deletions
diff --git a/actionmailer/lib/action_mailer/collector.rb b/actionmailer/lib/action_mailer/collector.rb
index 5431efccfe..bd4f76bbb6 100644
--- a/actionmailer/lib/action_mailer/collector.rb
+++ b/actionmailer/lib/action_mailer/collector.rb
@@ -11,7 +11,6 @@ module ActionMailer #:nodoc:
@context = context
@responses = []
@default_render = block
- @default_formats = context.formats
end
def any(*args, &block)
@@ -21,16 +20,12 @@ module ActionMailer #:nodoc:
end
alias :all :any
- def custom(mime, options={}, &block)
+ def custom(mime, options={})
options.reverse_merge!(:content_type => mime.to_s)
@context.formats = [mime.to_sym]
- options[:body] = if block
- block.call
- else
- @default_render.call
- end
+ @context.formats.freeze
+ options[:body] = block_given? ? yield : @default_render.call
@responses << options
- @context.formats = @default_formats
end
end
end \ No newline at end of file