aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/notifications.rb
diff options
context:
space:
mode:
authorJosé Valim <jose.valim@gmail.com>2009-10-15 18:51:51 -0300
committerJosé Valim <jose.valim@gmail.com>2009-10-15 18:51:51 -0300
commit2d7abe245e7a2b1717e48ef550e4083318fd7ec2 (patch)
tree0de135e1a3c5dadb3f6e1c5457832e6ef81bb834 /activerecord/lib/active_record/notifications.rb
parent5988b87c30eb0ce50c235187f5dfcfcfb98da01b (diff)
downloadrails-2d7abe245e7a2b1717e48ef550e4083318fd7ec2.tar.gz
rails-2d7abe245e7a2b1717e48ef550e4083318fd7ec2.tar.bz2
rails-2d7abe245e7a2b1717e48ef550e4083318fd7ec2.zip
Renamed Orchestra to Notifications once again [#3321 state:resolved]
Diffstat (limited to 'activerecord/lib/active_record/notifications.rb')
-rw-r--r--activerecord/lib/active_record/notifications.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/activerecord/lib/active_record/notifications.rb b/activerecord/lib/active_record/notifications.rb
new file mode 100644
index 0000000000..a5ce7ac524
--- /dev/null
+++ b/activerecord/lib/active_record/notifications.rb
@@ -0,0 +1,5 @@
+require 'active_support/notifications'
+
+ActiveSupport::Notifications.subscribe("sql") do |event|
+ ActiveRecord::Base.connection.log_info(event.payload[:sql], event.payload[:name], event.duration)
+end