aboutsummaryrefslogtreecommitdiffstats
path: root/actionmailer
diff options
context:
space:
mode:
authorwycats <wycats@gmail.com>2010-12-26 23:44:51 -0800
committerwycats <wycats@gmail.com>2010-12-26 23:44:51 -0800
commit7c568fda6ba2d6621a0872e4bc0c71bb2d13e65f (patch)
treea8970b817b89488117efbc86658b07f4738b78c4 /actionmailer
parent6c5a3bb3125735760e92f49c3824d757ef87c61e (diff)
downloadrails-7c568fda6ba2d6621a0872e4bc0c71bb2d13e65f.tar.gz
rails-7c568fda6ba2d6621a0872e4bc0c71bb2d13e65f.tar.bz2
rails-7c568fda6ba2d6621a0872e4bc0c71bb2d13e65f.zip
A bunch of cleanup on the inherited template patch
Diffstat (limited to 'actionmailer')
-rw-r--r--actionmailer/lib/action_mailer/base.rb11
-rw-r--r--actionmailer/lib/action_mailer/old_api.rb2
2 files changed, 3 insertions, 10 deletions
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