mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Make sure ActionView is loaded inorder to build view paths
This commit is contained in:
parent
c6b7d0f344
commit
f5bcbde1e3
1 changed files with 10 additions and 6 deletions
|
@ -340,9 +340,11 @@ Run `rake gems:install` to install the missing gems.
|
||||||
end
|
end
|
||||||
|
|
||||||
def load_view_paths
|
def load_view_paths
|
||||||
ActionView::PathSet::Path.eager_load_templates! if configuration.cache_classes
|
if configuration.frameworks.include?(:action_view)
|
||||||
ActionMailer::Base.template_root.load if configuration.frameworks.include?(:action_mailer)
|
ActionView::PathSet::Path.eager_load_templates! if configuration.cache_classes
|
||||||
ActionController::Base.view_paths.load if configuration.frameworks.include?(:action_controller)
|
ActionController::Base.view_paths.load if configuration.frameworks.include?(:action_controller)
|
||||||
|
ActionMailer::Base.template_root.load if configuration.frameworks.include?(:action_mailer)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
# Eager load application classes
|
# Eager load application classes
|
||||||
|
@ -440,9 +442,11 @@ Run `rake gems:install` to install the missing gems.
|
||||||
# paths have already been set, it is not changed, otherwise it is
|
# paths have already been set, it is not changed, otherwise it is
|
||||||
# set to use Configuration#view_path.
|
# set to use Configuration#view_path.
|
||||||
def initialize_framework_views
|
def initialize_framework_views
|
||||||
view_path = ActionView::PathSet::Path.new(configuration.view_path, false)
|
if configuration.frameworks.include?(:action_view)
|
||||||
ActionMailer::Base.template_root ||= view_path if configuration.frameworks.include?(:action_mailer)
|
view_path = ActionView::PathSet::Path.new(configuration.view_path, false)
|
||||||
ActionController::Base.view_paths = view_path if configuration.frameworks.include?(:action_controller) && ActionController::Base.view_paths.empty?
|
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
|
||||||
end
|
end
|
||||||
|
|
||||||
# If Action Controller is not one of the loaded frameworks (Configuration#frameworks)
|
# If Action Controller is not one of the loaded frameworks (Configuration#frameworks)
|
||||||
|
|
Loading…
Reference in a new issue