diff options
Diffstat (limited to 'railties/lib')
-rw-r--r-- | railties/lib/initializer.rb | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/railties/lib/initializer.rb b/railties/lib/initializer.rb index 2cc0943b78..11aa8a534e 100644 --- a/railties/lib/initializer.rb +++ b/railties/lib/initializer.rb @@ -181,6 +181,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 @@ -364,6 +367,15 @@ Run `rake gems:install` to install the missing gems. end end + def load_view_paths + if configuration.frameworks.include?(:action_view) + if configuration.cache_classes + ActionController::Base.view_paths = configuration.view_path if configuration.frameworks.include?(:action_controller) + ActionMailer::Base.template_root = view_path if configuration.frameworks.include?(:action_mailer) + end + end + end + # Eager load application classes def load_application_classes return if $rails_rake_task |