mirror of
https://github.com/github/rails.git
synced 2026-01-27 07:17:58 -05:00
Only create a path for ActionMailer template root instead of a path set. Better fix than 7461227
This commit is contained in:
@@ -426,7 +426,7 @@ module ActionMailer #:nodoc:
|
||||
end
|
||||
|
||||
def template_root=(root)
|
||||
write_inheritable_attribute(:template_root, ActionView::PathSet.new(Array(root)))
|
||||
write_inheritable_attribute(:template_root, ActionView::PathSet::Path.new(root))
|
||||
end
|
||||
end
|
||||
|
||||
@@ -541,7 +541,7 @@ module ActionMailer #:nodoc:
|
||||
end
|
||||
|
||||
def template_path
|
||||
"#{template_root.join}/#{mailer_name}"
|
||||
"#{template_root}/#{mailer_name}"
|
||||
end
|
||||
|
||||
def initialize_template_class(assigns)
|
||||
|
||||
@@ -942,13 +942,13 @@ end # uses_mocha
|
||||
class InheritableTemplateRootTest < Test::Unit::TestCase
|
||||
def test_attr
|
||||
expected = "#{File.dirname(__FILE__)}/fixtures/path.with.dots"
|
||||
assert_equal [expected], FunkyPathMailer.template_root.map(&:to_s)
|
||||
assert_equal expected, FunkyPathMailer.template_root
|
||||
|
||||
sub = Class.new(FunkyPathMailer)
|
||||
sub.template_root = 'test/path'
|
||||
|
||||
assert_equal ['test/path'], sub.template_root.map(&:to_s)
|
||||
assert_equal [expected], FunkyPathMailer.template_root.map(&:to_s)
|
||||
assert_equal 'test/path', sub.template_root
|
||||
assert_equal expected, FunkyPathMailer.template_root
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user