diff options
author | Joshua Peek <josh@joshpeek.com> | 2008-07-23 10:41:28 -0500 |
---|---|---|
committer | Joshua Peek <josh@joshpeek.com> | 2008-07-23 10:41:28 -0500 |
commit | 97a954bf1dd05e79a873bffc94fcf5420b807371 (patch) | |
tree | 76f072b03526a4a46799a56e62bbd2950cea1570 /railties | |
parent | db1bac796e2d53fac4b51a3f560010b8f663fb54 (diff) | |
download | rails-97a954bf1dd05e79a873bffc94fcf5420b807371.tar.gz rails-97a954bf1dd05e79a873bffc94fcf5420b807371.tar.bz2 rails-97a954bf1dd05e79a873bffc94fcf5420b807371.zip |
Load view path cache after plugins and gems.
Diffstat (limited to 'railties')
-rw-r--r-- | railties/lib/initializer.rb | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/railties/lib/initializer.rb b/railties/lib/initializer.rb index 828d688475..97bb81a3c8 100644 --- a/railties/lib/initializer.rb +++ b/railties/lib/initializer.rb @@ -168,6 +168,9 @@ module Rails # Observers are loaded after plugins in case Observers or observed models are modified by plugins. load_observers + # Load view path cache + load_view_paths + # load application classes load_application_classes @@ -333,6 +336,12 @@ Run `rake gems:install` to install the missing gems. end end + def load_view_paths + ActionView::PathSet::Path.eager_load_templates! if configuration.cache_classes + ActionMailer::Base.template_root.load + ActionController::Base.view_paths.load + end + # Eager load application classes def load_application_classes if configuration.cache_classes @@ -428,9 +437,7 @@ 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 - ActionView::PathSet::Path.eager_load_templates! if configuration.cache_classes - view_path = ActionView::PathSet::Path.new(configuration.view_path) - + 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 |