From 909a7f430ba37cd7a54ae11a7af529bd949fa31c Mon Sep 17 00:00:00 2001 From: Jeremy Kemper Date: Thu, 31 Jul 2008 17:51:43 -0700 Subject: Ensure mailer view path is loaded when it's assigned. Path#[] raises if it isn't loaded. --- actionmailer/lib/action_mailer/base.rb | 2 +- actionpack/lib/action_view/paths.rb | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) 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 -- cgit v1.2.3