Permalink
Browse files

Ensure mailer view path is loaded when it's assigned. Path#[] raises …

…if it isn't loaded.
  • Loading branch information...
1 parent ad45535 commit 909a7f430ba37cd7a54ae11a7af529bd949fa31c @jeremy jeremy committed Aug 1, 2008
Showing with 3 additions and 1 deletion.
  1. +1 −1 actionmailer/lib/action_mailer/base.rb
  2. +2 −0 actionpack/lib/action_view/paths.rb
@@ -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
@@ -42,6 +42,7 @@ def eql?(path)
end
def [](path)
+ raise "Unloaded view path! #{@path}" unless @loaded
@paths[path]
end
@@ -51,6 +52,7 @@ def loaded?
def load
reload! unless loaded?
+ self
end
# Rebuild load path directory cache

0 comments on commit 909a7f4

Please sign in to comment.