diff options
author | Gonçalo Silva <goncalossilva@gmail.com> | 2010-06-30 23:01:30 +0100 |
---|---|---|
committer | Gonçalo Silva <goncalossilva@gmail.com> | 2010-06-30 23:01:30 +0100 |
commit | d2c633ba0bfb7baacdee89a46d7d036d24c68817 (patch) | |
tree | 8f0974852b51597652e6ae73da26f3eb80fe878b /activerecord/lib/active_record/railties/log_subscriber.rb | |
parent | 92c0f17d6d2a958d3a6285b0e5408e9e0e7122e1 (diff) | |
parent | c63cf7bf0db708fe46a929cf57649ab5a92034af (diff) | |
download | rails-d2c633ba0bfb7baacdee89a46d7d036d24c68817.tar.gz rails-d2c633ba0bfb7baacdee89a46d7d036d24c68817.tar.bz2 rails-d2c633ba0bfb7baacdee89a46d7d036d24c68817.zip |
Merge branch 'master' of http://github.com/rails/rails
Diffstat (limited to 'activerecord/lib/active_record/railties/log_subscriber.rb')
-rw-r--r-- | activerecord/lib/active_record/railties/log_subscriber.rb | 32 |
1 files changed, 0 insertions, 32 deletions
diff --git a/activerecord/lib/active_record/railties/log_subscriber.rb b/activerecord/lib/active_record/railties/log_subscriber.rb deleted file mode 100644 index 31b98bb6ed..0000000000 --- a/activerecord/lib/active_record/railties/log_subscriber.rb +++ /dev/null @@ -1,32 +0,0 @@ -module ActiveRecord - module Railties - class LogSubscriber < Rails::LogSubscriber - def initialize - super - @odd_or_even = false - end - - def sql(event) - name = '%s (%.1fms)' % [event.payload[:name], event.duration] - sql = event.payload[:sql].squeeze(' ') - - if odd? - name = color(name, :cyan, true) - sql = color(sql, nil, true) - else - name = color(name, :magenta, true) - end - - debug " #{name} #{sql}" - end - - def odd? - @odd_or_even = !@odd_or_even - end - - def logger - ActiveRecord::Base.logger - end - end - end -end |