From dc2e291a939e1089300bdac972cb7b63548d9ec1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Valim?= Date: Tue, 12 Jan 2010 18:29:48 +0100 Subject: Move AR logging responsibilities to ActiveRecord::Railties::Subscriber. --- activerecord/lib/active_record/railtie.rb | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) (limited to 'activerecord/lib/active_record/railtie.rb') diff --git a/activerecord/lib/active_record/railtie.rb b/activerecord/lib/active_record/railtie.rb index a07f33503d..88d0aa624f 100644 --- a/activerecord/lib/active_record/railtie.rb +++ b/activerecord/lib/active_record/railtie.rb @@ -14,6 +14,10 @@ module ActiveRecord load "active_record/railties/databases.rake" end + # TODO If we require the wrong file, the error never comes up. + require "active_record/railties/subscriber" + subscriber ActiveRecord::Railties::Subscriber.new + initializer "active_record.set_configs" do |app| app.config.active_record.each do |k,v| ActiveRecord::Base.send "#{k}=", v @@ -59,14 +63,6 @@ module ActiveRecord ActiveRecord::Base.logger ||= ::Rails.logger end - initializer "active_record.notifications" do - require 'active_support/notifications' - - ActiveSupport::Notifications.subscribe("active_record.sql") do |name, before, after, instrumenter_id, payload| - payload[:connection].log_info(payload[:sql], payload[:name], (after - before) * 1000) - end - end - initializer "active_record.i18n_deprecation" do require 'active_support/i18n' -- cgit v1.2.3