Permalink
Browse files

Only configure settings for loaded frameworks

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2304 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
  • Loading branch information...
1 parent 2a31691 commit 436d54c3f19fc80713d975482a28a95cfa60a1e4 @dhh dhh committed Sep 22, 2005
Showing with 6 additions and 4 deletions.
  1. +6 −4 railties/lib/initializer.rb
@@ -100,13 +100,15 @@ def initialize_logger
end
def initialize_framework_logging
- # TODO: Only do logging for frameworks loaded
- [ActiveRecord, ActionController, ActionMailer].each { |mod| mod::Base.logger ||= RAILS_DEFAULT_LOGGER }
+ for framework in ([ :active_record, :action_controller, :action_mailer ] & configuration.frameworks)
+ framework.to_s.camelize.constantize.const_get("Base").logger ||= RAILS_DEFAULT_LOGGER
+ end
end
def initialize_framework_views
- # TODO: Only do view setting for frameworks loaded
- [ActionController, ActionMailer].each { |mod| mod::Base.template_root ||= configuration.view_path }
+ for framework in ([ :action_controller, :action_mailer ] & configuration.frameworks)
+ framework.to_s.camelize.constantize.const_get("Base").template_root ||= configuration.view_path
+ end
end
def initialize_routing

0 comments on commit 436d54c

Please sign in to comment.