diff options
author | Jeremy Kemper <jeremy@bitsweat.net> | 2008-07-31 17:51:43 -0700 |
---|---|---|
committer | Jeremy Kemper <jeremy@bitsweat.net> | 2008-07-31 17:51:43 -0700 |
commit | 909a7f430ba37cd7a54ae11a7af529bd949fa31c (patch) | |
tree | c6fd728961c15c6fe66b1e52b878762ca70b81e3 | |
parent | ad4553587efb8e758349b3f163e365781e4c6ad1 (diff) | |
download | rails-909a7f430ba37cd7a54ae11a7af529bd949fa31c.tar.gz rails-909a7f430ba37cd7a54ae11a7af529bd949fa31c.tar.bz2 rails-909a7f430ba37cd7a54ae11a7af529bd949fa31c.zip |
Ensure mailer view path is loaded when it's assigned. Path#[] raises if it isn't loaded.
-rw-r--r-- | actionmailer/lib/action_mailer/base.rb | 2 | ||||
-rw-r--r-- | actionpack/lib/action_view/paths.rb | 2 |
2 files changed, 3 insertions, 1 deletions
diff --git a/actionmailer/lib/action_mailer/base.rb b/actionmailer/lib/action_mailer/base.rb index a43296461b..88d34a58d5 100644 --- a/actionmailer/lib/action_mailer/base.rb +++ b/actionmailer/lib/action_mailer/base.rb @@ -427,7 +427,7 @@ module ActionMailer #:nodoc: 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 diff --git a/actionpack/lib/action_view/paths.rb b/actionpack/lib/action_view/paths.rb index a37706faee..d97f963540 100644 --- a/actionpack/lib/action_view/paths.rb +++ b/actionpack/lib/action_view/paths.rb @@ -42,6 +42,7 @@ module ActionView #:nodoc: end def [](path) + raise "Unloaded view path! #{@path}" unless @loaded @paths[path] end @@ -51,6 +52,7 @@ module ActionView #:nodoc: def load reload! unless loaded? + self end # Rebuild load path directory cache |