1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Send paths argument as an array rather than converting it internally

This commit is contained in:
Carlos Antonio da Silva 2013-01-28 23:22:50 -02:00
parent 2cb576ef36
commit 744307e525

View file

@ -748,7 +748,7 @@ module ActionMailer
templates_path = headers.delete(:template_path) || self.class.mailer_name
templates_name = headers.delete(:template_name) || action_name
each_template(templates_path, templates_name) do |template|
each_template(Array(templates_path), templates_name) do |template|
self.formats = template.formats
responses << {
@ -762,9 +762,9 @@ module ActionMailer
end
def each_template(paths, name, &block) #:nodoc:
templates = lookup_context.find_all(name, Array(paths))
templates = lookup_context.find_all(name, paths)
if templates.empty?
raise ActionView::MissingTemplate.new([paths], name, [paths], false, 'mailer')
raise ActionView::MissingTemplate.new(paths, name, paths, false, 'mailer')
else
templates.uniq { |t| t.formats }.each(&block)
end