aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/rails.rb
diff options
context:
space:
mode:
authorCarlhuda <carlhuda@engineyard.com>2009-12-23 17:01:07 -0800
committerCarlhuda <carlhuda@engineyard.com>2009-12-23 17:23:29 -0800
commitd2bd71a145ddc5e3e3750edc9a09eab742aaf02a (patch)
treeda4a935d5d161090373aae6593453d910101c1c6 /activerecord/lib/active_record/rails.rb
parent61af34b001b295af36c346d245a65d74de0e1f97 (diff)
downloadrails-d2bd71a145ddc5e3e3750edc9a09eab742aaf02a.tar.gz
rails-d2bd71a145ddc5e3e3750edc9a09eab742aaf02a.tar.bz2
rails-d2bd71a145ddc5e3e3750edc9a09eab742aaf02a.zip
Finish moving config.frameworks-dependent code to the framework plugin
Diffstat (limited to 'activerecord/lib/active_record/rails.rb')
-rw-r--r--activerecord/lib/active_record/rails.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/activerecord/lib/active_record/rails.rb b/activerecord/lib/active_record/rails.rb
index 4071385563..ddbc555113 100644
--- a/activerecord/lib/active_record/rails.rb
+++ b/activerecord/lib/active_record/rails.rb
@@ -47,5 +47,13 @@ module ActiveRecord
ActiveRecord::Base.logger ||= Rails.logger
end
+ initializer "active_record.notifications" do
+ require 'active_support/notifications'
+
+ ActiveSupport::Notifications.subscribe("sql") do |name, before, after, result, instrumenter_id, payload|
+ ActiveRecord::Base.connection.log_info(payload[:sql], name, after - before)
+ end
+ end
+
end
end \ No newline at end of file