Permalink
Browse files

Only create a path for ActionMailer template root instead of a path s…

…et. Better fix than 7461227
  • Loading branch information...
josh committed Jul 19, 2008
1 parent 7461227 commit e23156e87bd32206a5ea529fbecc04fdf37d7bc2
Showing with 5 additions and 5 deletions.
  1. +2 −2 actionmailer/lib/action_mailer/base.rb
  2. +3 −3 actionmailer/test/mail_service_test.rb
@@ -426,7 +426,7 @@ def register_template_extension(extension)
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 @@ def render(opts)
end
def template_path
- "#{template_root.join}/#{mailer_name}"
+ "#{template_root}/#{mailer_name}"
end
def initialize_template_class(assigns)
@@ -942,13 +942,13 @@ def test_return_path_with_deliver
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

0 comments on commit e23156e

Please sign in to comment.