Permalink
Browse files

Moar DRY and stuff

  • Loading branch information...
1 parent 788f2ad commit 4824ef432ede6740612f27c8270923e119891b51 @kch kch committed with pdsphil Apr 15, 2011
Showing with 4 additions and 5 deletions.
  1. +4 −5 init.rb
View
@@ -18,9 +18,8 @@ def Rails.logger
end
# borrowed from Rails::Initializer#initialize_framework_logging
- ([ :active_record, :action_controller, :action_mailer ] & Rails.configuration.frameworks).each do |framework|
- framework.to_s.camelize.constantize.const_get("Base").logger = Rails.logger
- end
- ActiveSupport::Dependencies.logger = Rails.logger
- Rails.cache.logger = Rails.logger
+ [ActiveSupport::Dependencies, Rails.cache].concat(
+ ([:active_record, :action_controller, :action_mailer] & Rails.configuration.frameworks)\
+ .map { |framework| framework.to_s.camelize.constantize.const_get("Base") }
+ ).each { |k| k.logger = Rails.logger }
end

0 comments on commit 4824ef4

Please sign in to comment.