Permalink
Browse files

Update Rails Initializer to use ActionController::Base#view_paths [Rick]

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6126 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
  • Loading branch information...
1 parent 92195e6 commit f2f2686f97363652b8d38a6e67c27e555030ad4b @technoweenie technoweenie committed Feb 4, 2007
Showing with 6 additions and 5 deletions.
  1. +2 −0 railties/CHANGELOG
  2. +4 −5 railties/lib/initializer.rb
View
@@ -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]
@@ -268,14 +268,13 @@ def initialize_framework_logging
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)

0 comments on commit f2f2686

Please sign in to comment.