diff options
author | Joshua Peek <josh@joshpeek.com> | 2008-08-06 17:40:03 -0500 |
---|---|---|
committer | Joshua Peek <josh@joshpeek.com> | 2008-08-06 17:40:03 -0500 |
commit | f5bcbde1e387020c7f4968515921a3ccee3dcda2 (patch) | |
tree | f19eed5c0c26ced0fcf91ef8683749bb3b05d131 /railties/lib | |
parent | c6b7d0f34472ee7ef03d602c8923fd0ba8dab833 (diff) | |
download | rails-f5bcbde1e387020c7f4968515921a3ccee3dcda2.tar.gz rails-f5bcbde1e387020c7f4968515921a3ccee3dcda2.tar.bz2 rails-f5bcbde1e387020c7f4968515921a3ccee3dcda2.zip |
Make sure ActionView is loaded inorder to build view paths
Diffstat (limited to 'railties/lib')
-rw-r--r-- | railties/lib/initializer.rb | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/railties/lib/initializer.rb b/railties/lib/initializer.rb index 4036b14f19..6576cd368b 100644 --- a/railties/lib/initializer.rb +++ b/railties/lib/initializer.rb @@ -340,9 +340,11 @@ Run `rake gems:install` to install the missing gems. end def load_view_paths - ActionView::PathSet::Path.eager_load_templates! if configuration.cache_classes - ActionMailer::Base.template_root.load if configuration.frameworks.include?(:action_mailer) - ActionController::Base.view_paths.load if configuration.frameworks.include?(:action_controller) + if configuration.frameworks.include?(:action_view) + ActionView::PathSet::Path.eager_load_templates! if configuration.cache_classes + ActionController::Base.view_paths.load if configuration.frameworks.include?(:action_controller) + ActionMailer::Base.template_root.load if configuration.frameworks.include?(:action_mailer) + end end # 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 # set to use Configuration#view_path. def initialize_framework_views - view_path = ActionView::PathSet::Path.new(configuration.view_path, false) - 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? + if configuration.frameworks.include?(:action_view) + view_path = ActionView::PathSet::Path.new(configuration.view_path, false) + 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 # If Action Controller is not one of the loaded frameworks (Configuration#frameworks) |