diff options
Diffstat (limited to 'activerecord/lib/active_record/log_subscriber.rb')
-rw-r--r-- | activerecord/lib/active_record/log_subscriber.rb | 56 |
1 files changed, 28 insertions, 28 deletions
diff --git a/activerecord/lib/active_record/log_subscriber.rb b/activerecord/lib/active_record/log_subscriber.rb index c4998ba686..bb9f898cf0 100644 --- a/activerecord/lib/active_record/log_subscriber.rb +++ b/activerecord/lib/active_record/log_subscriber.rb @@ -57,38 +57,38 @@ module ActiveRecord private - def colorize_payload_name(name, payload_name) - if payload_name.blank? || payload_name == "SQL" # SQL vs Model Load/Exists - color(name, MAGENTA, true) - else - color(name, CYAN, true) + def colorize_payload_name(name, payload_name) + if payload_name.blank? || payload_name == "SQL" # SQL vs Model Load/Exists + color(name, MAGENTA, true) + else + color(name, CYAN, true) + end end - end - def sql_color(sql) - case sql - when /\A\s*rollback/mi - RED - when /select .*for update/mi, /\A\s*lock/mi - WHITE - when /\A\s*select/i - BLUE - when /\A\s*insert/i - GREEN - when /\A\s*update/i - YELLOW - when /\A\s*delete/i - RED - when /transaction\s*\Z/i - CYAN - else - MAGENTA + def sql_color(sql) + case sql + when /\A\s*rollback/mi + RED + when /select .*for update/mi, /\A\s*lock/mi + WHITE + when /\A\s*select/i + BLUE + when /\A\s*insert/i + GREEN + when /\A\s*update/i + YELLOW + when /\A\s*delete/i + RED + when /transaction\s*\Z/i + CYAN + else + MAGENTA + end end - end - def logger - ActiveRecord::Base.logger - end + def logger + ActiveRecord::Base.logger + end end end |