aboutsummaryrefslogtreecommitdiffstats
path: root/railties
diff options
context:
space:
mode:
authorRick Olson <technoweenie@gmail.com>2007-02-04 22:41:37 +0000
committerRick Olson <technoweenie@gmail.com>2007-02-04 22:41:37 +0000
commitf2f2686f97363652b8d38a6e67c27e555030ad4b (patch)
treed72e6578958a08d62da94d3b63e47ef3bb9c787a /railties
parent92195e68a02715d29ef9d4b3bf66409c014f7174 (diff)
downloadrails-f2f2686f97363652b8d38a6e67c27e555030ad4b.tar.gz
rails-f2f2686f97363652b8d38a6e67c27e555030ad4b.tar.bz2
rails-f2f2686f97363652b8d38a6e67c27e555030ad4b.zip
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
Diffstat (limited to 'railties')
-rw-r--r--railties/CHANGELOG2
-rw-r--r--railties/lib/initializer.rb9
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)