From fea5b6fd41f7d667fe637c9e9e31b51489ee5a50 Mon Sep 17 00:00:00 2001 From: Joshua Peek Date: Tue, 15 Jul 2008 22:57:20 -0500 Subject: ActionMailer and ActionView can share the same view path cache --- railties/lib/initializer.rb | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/railties/lib/initializer.rb b/railties/lib/initializer.rb index 0b052e1fda..b9e890a3e4 100644 --- a/railties/lib/initializer.rb +++ b/railties/lib/initializer.rb @@ -415,8 +415,10 @@ Run `rake gems:install` to install the missing gems. # set to use Configuration#view_path. def initialize_framework_views ActionView::PathSet::Path.eager_load_templates! if configuration.cache_classes - ActionMailer::Base.template_root ||= configuration.view_path if configuration.frameworks.include?(:action_mailer) - ActionController::Base.view_paths = [configuration.view_path] if configuration.frameworks.include?(:action_controller) && ActionController::Base.view_paths.empty? + view_path = ActionView::PathSet::Path.new(configuration.view_path) + + ActionMailer::Base.template_root ||= view_path if configuration.frameworks.include?(:action_mailer) + ActionController::Base.view_paths = view_path if configuration.frameworks.include?(:action_controller) && ActionController::Base.view_paths.empty? end # If Action Controller is not one of the loaded frameworks (Configuration#frameworks) -- cgit v1.2.3