diff options
author | David Heinemeier Hansson <david@loudthinking.com> | 2009-12-27 14:44:21 -0800 |
---|---|---|
committer | David Heinemeier Hansson <david@loudthinking.com> | 2009-12-27 14:44:21 -0800 |
commit | 5012a1558dd1483df525f1fac1e649e089be886a (patch) | |
tree | 983136a50ee7bb135768038e33c9c226a3a167ed /activerecord/lib/active_record/rails.rb | |
parent | 1cd949006a419807d5ae3400442942b752780ca2 (diff) | |
parent | 12e43494a748e0144195be12dc19161cc3e4d39f (diff) | |
download | rails-5012a1558dd1483df525f1fac1e649e089be886a.tar.gz rails-5012a1558dd1483df525f1fac1e649e089be886a.tar.bz2 rails-5012a1558dd1483df525f1fac1e649e089be886a.zip |
Merge branch 'master' of github.com:rails/rails
Diffstat (limited to 'activerecord/lib/active_record/rails.rb')
-rw-r--r-- | activerecord/lib/active_record/rails.rb | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/activerecord/lib/active_record/rails.rb b/activerecord/lib/active_record/rails.rb index ddbc555113..8b22f869bc 100644 --- a/activerecord/lib/active_record/rails.rb +++ b/activerecord/lib/active_record/rails.rb @@ -7,6 +7,9 @@ require "action_controller/rails" module ActiveRecord class Plugin < Rails::Plugin plugin_name :active_record + include_modules_in "ActiveRecord::Base" + + config.action_controller.include "ActiveRecord::ControllerRuntime" initializer "active_record.set_configs" do |app| app.config.active_record.each do |k,v| @@ -50,8 +53,8 @@ module ActiveRecord 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) + ActiveSupport::Notifications.subscribe("sql") do |name, before, after, instrumenter_id, payload| + ActiveRecord::Base.connection.log_info(payload[:sql], payload[:name], (after - before) * 1000) end end |