Skip to content

Commit

Permalink
Ensure mailer view path is loaded when it's assigned. Path#[] raises …
Browse files Browse the repository at this point in the history
…if it isn't loaded.
  • Loading branch information
jeremy committed Aug 1, 2008
1 parent ad45535 commit 909a7f4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion actionmailer/lib/action_mailer/base.rb
Original file line number Diff line number Diff line change
Expand Up @@ -427,7 +427,7 @@ def register_template_extension(extension)

def template_root=(root)
root = ActionView::PathSet::Path.new(root) if root.is_a?(String)
write_inheritable_attribute(:template_root, root)
write_inheritable_attribute(:template_root, root.load)
end
end

Expand Down
2 changes: 2 additions & 0 deletions actionpack/lib/action_view/paths.rb
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ def eql?(path)
end

def [](path)
raise "Unloaded view path! #{@path}" unless @loaded
@paths[path]
end

Expand All @@ -51,6 +52,7 @@ def loaded?

def load
reload! unless loaded?
self
end

# Rebuild load path directory cache
Expand Down

0 comments on commit 909a7f4

Please sign in to comment.