db_debug 0.0.4 → 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/db_debug/active_record.rb +1 -5
- data/lib/db_debug/engine.rb +4 -0
- data/lib/db_debug/logger.rb +5 -1
- data/lib/db_debug/version.rb +1 -1
- data/lib/db_debug.rb +1 -1
- metadata +1 -1
@@ -1,5 +1,3 @@
|
|
1
|
-
require 'active_record/connection_adapters/postgresql_adapter'
|
2
|
-
|
3
1
|
class DbDebug
|
4
2
|
module ActiveRecord
|
5
3
|
module ConnectionAdapters
|
@@ -37,6 +35,4 @@ class DbDebug
|
|
37
35
|
end
|
38
36
|
end
|
39
37
|
end
|
40
|
-
end
|
41
|
-
|
42
|
-
ActiveRecord::ConnectionAdapters::PostgreSQLAdapter.send(:include, DbDebug::ActiveRecord::ConnectionAdapters::PostgreSQLAdapter)
|
38
|
+
end
|
data/lib/db_debug/engine.rb
CHANGED
data/lib/db_debug/logger.rb
CHANGED
@@ -13,7 +13,11 @@ class DbDebug
|
|
13
13
|
|
14
14
|
def self.log color, str
|
15
15
|
code = COLOR_MAP[color]
|
16
|
-
|
16
|
+
str = "\033[0;#{code}m#{str}\033[0;#37m"
|
17
|
+
Rails.logger.debug str
|
18
|
+
if defined? IRB
|
19
|
+
puts str
|
20
|
+
end
|
17
21
|
end
|
18
22
|
|
19
23
|
def self.determine_color count, time
|
data/lib/db_debug/version.rb
CHANGED
data/lib/db_debug.rb
CHANGED