From 7c568fda6ba2d6621a0872e4bc0c71bb2d13e65f Mon Sep 17 00:00:00 2001 From: wycats Date: Sun, 26 Dec 2010 23:44:51 -0800 Subject: A bunch of cleanup on the inherited template patch --- actionmailer/lib/action_mailer/base.rb | 11 ++--------- actionmailer/lib/action_mailer/old_api.rb | 2 +- 2 files changed, 3 insertions(+), 10 deletions(-) (limited to 'actionmailer') diff --git a/actionmailer/lib/action_mailer/base.rb b/actionmailer/lib/action_mailer/base.rb index 840708cdc6..d67d563181 100644 --- a/actionmailer/lib/action_mailer/base.rb +++ b/actionmailer/lib/action_mailer/base.rb @@ -693,15 +693,8 @@ module ActionMailer #:nodoc: end def each_template(paths, name, &block) #:nodoc: - Array.wrap(paths).each do |path| - templates = lookup_context.find_all(name, path) - templates = templates.uniq_by { |t| t.formats } - - unless templates.empty? - templates.each(&block) - return - end - end + templates = lookup_context.find_all(name, Array.wrap(paths)) + templates.uniq_by { |t| t.formats }.each(&block) end def create_parts_from_responses(m, responses) #:nodoc: diff --git a/actionmailer/lib/action_mailer/old_api.rb b/actionmailer/lib/action_mailer/old_api.rb index a8d7454898..dedb447ced 100644 --- a/actionmailer/lib/action_mailer/old_api.rb +++ b/actionmailer/lib/action_mailer/old_api.rb @@ -201,7 +201,7 @@ module ActionMailer if String === @body @parts.unshift create_inline_part(@body) elsif @parts.empty? || @parts.all? { |p| p.content_disposition =~ /^attachment/ } - lookup_context.find_all(@template, @mailer_name).each do |template| + lookup_context.find_all(@template, [@mailer_name]).each do |template| self.formats = template.formats @parts << create_inline_part(render(:template => template), template.mime_type) end -- cgit v1.2.3