Skip to content

Commit

Permalink
Only create a path for ActionMailer template root instead of a path s…
Browse files Browse the repository at this point in the history
…et. Better fix than 7461227
  • Loading branch information
josh committed Jul 19, 2008
1 parent 7461227 commit e23156e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions actionmailer/lib/action_mailer/base.rb
Expand Up @@ -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

Expand Down Expand Up @@ -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)
Expand Down
6 changes: 3 additions & 3 deletions actionmailer/test/mail_service_test.rb
Expand Up @@ -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

Expand Down

0 comments on commit e23156e

Please sign in to comment.