diff options
Diffstat (limited to 'railties')
-rw-r--r-- | railties/CHANGELOG | 2 | ||||
-rw-r--r-- | railties/lib/initializer.rb | 9 |
2 files changed, 6 insertions, 5 deletions
diff --git a/railties/CHANGELOG b/railties/CHANGELOG index 2b7ef8f8dd..993b6de71c 100644 --- a/railties/CHANGELOG +++ b/railties/CHANGELOG @@ -1,5 +1,7 @@ *SVN* +* Update Rails Initializer to use ActionController::Base#view_paths [Rick] + * Fix gem deprecation warnings, which also means depending on RubyGems 0.9.0+ [Chad Fowler] * Plugins may be symlinked in vendor/plugins. #4245 [brandon, progrium@gmail.com] diff --git a/railties/lib/initializer.rb b/railties/lib/initializer.rb index 6bb65d3871..81cd783a6c 100644 --- a/railties/lib/initializer.rb +++ b/railties/lib/initializer.rb @@ -268,14 +268,13 @@ module Rails end end - # Sets the +template_root+ for ActionController::Base and ActionMailer::Base + # Sets +ActionController::BaseEview_paths+ and +ActionMailer::Base#template_root+ # (but only for those frameworks that are to be loaded). If the framework's - # +template_root+ has 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. def initialize_framework_views - for framework in ([ :action_controller, :action_mailer ] & configuration.frameworks) - framework.to_s.camelize.constantize.const_get("Base").template_root ||= configuration.view_path - end + 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) end # If ActionController is not one of the loaded frameworks (Configuration#frameworks) |