diff options
author | Carlhuda <carlhuda@engineyard.com> | 2009-12-23 17:01:07 -0800 |
---|---|---|
committer | Carlhuda <carlhuda@engineyard.com> | 2009-12-23 17:23:29 -0800 |
commit | d2bd71a145ddc5e3e3750edc9a09eab742aaf02a (patch) | |
tree | da4a935d5d161090373aae6593453d910101c1c6 /activerecord | |
parent | 61af34b001b295af36c346d245a65d74de0e1f97 (diff) | |
download | rails-d2bd71a145ddc5e3e3750edc9a09eab742aaf02a.tar.gz rails-d2bd71a145ddc5e3e3750edc9a09eab742aaf02a.tar.bz2 rails-d2bd71a145ddc5e3e3750edc9a09eab742aaf02a.zip |
Finish moving config.frameworks-dependent code to the framework plugin
Diffstat (limited to 'activerecord')
-rw-r--r-- | activerecord/lib/active_record/notifications.rb | 5 | ||||
-rw-r--r-- | activerecord/lib/active_record/rails.rb | 8 |
2 files changed, 8 insertions, 5 deletions
diff --git a/activerecord/lib/active_record/notifications.rb b/activerecord/lib/active_record/notifications.rb deleted file mode 100644 index 562a5b91f4..0000000000 --- a/activerecord/lib/active_record/notifications.rb +++ /dev/null @@ -1,5 +0,0 @@ -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 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 |