Only create a path for ActionMailer template root instead of a path set. Better fix than 7461227

This commit is contained in:
Joshua Peek
2008-07-19 12:35:42 -05:00
parent 7461227352
commit e23156e87b
2 changed files with 5 additions and 5 deletions

View File

@@ -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)

View File

@@ -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