diff options
Diffstat (limited to 'actionmailer/lib/action_mailer/base.rb')
-rw-r--r-- | actionmailer/lib/action_mailer/base.rb | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/actionmailer/lib/action_mailer/base.rb b/actionmailer/lib/action_mailer/base.rb index 7101bfbb70..84d50fa1f4 100644 --- a/actionmailer/lib/action_mailer/base.rb +++ b/actionmailer/lib/action_mailer/base.rb @@ -1,5 +1,8 @@ require 'active_support/core_ext/class' +require 'active_support/core_ext/object/blank' +require 'active_support/core_ext/array/uniq_by' require 'active_support/core_ext/module/delegation' +require 'active_support/core_ext/string/inflections' require 'mail' require 'action_mailer/tmail_compat' require 'action_mailer/collector' @@ -455,6 +458,8 @@ module ActionMailer #:nodoc: def each_template(&block) #:nodoc: self.class.view_paths.each do |load_paths| templates = load_paths.find_all(action_name, {}, self.class.mailer_name) + templates = templates.uniq_by { |t| t.details[:formats] } + unless templates.empty? templates.each(&block) return |