Browse files

ActionMailer and ActionView can share the same view path cache

  • Loading branch information...
1 parent 83e29b9 commit fea5b6fd41f7d667fe637c9e9e31b51489ee5a50 @josh josh committed Jul 15, 2008
Showing with 4 additions and 2 deletions.
  1. +4 −2 railties/lib/initializer.rb
View
6 railties/lib/initializer.rb
@@ -415,8 +415,10 @@ def initialize_framework_logging
# 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)

0 comments on commit fea5b6f

Please sign in to comment.