Skip to content

Commit

Permalink
ActionMailer and ActionView can share the same view path cache
Browse files Browse the repository at this point in the history
  • Loading branch information
josh committed Jul 16, 2008
1 parent 83e29b9 commit fea5b6f
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions railties/lib/initializer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit fea5b6f

Please sign in to comment.