db_debug 0.0.5 → 0.0.6
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/db_debug/logger.rb +3 -2
- data/lib/db_debug/middleware.rb +3 -1
- data/lib/db_debug/version.rb +1 -1
- metadata +1 -1
data/lib/db_debug/logger.rb
CHANGED
@@ -14,9 +14,10 @@ class DbDebug
|
|
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
|
-
|
18
|
-
if defined? IRB
|
17
|
+
if self.private_methods.include? 'irb_binding'
|
19
18
|
puts str
|
19
|
+
else
|
20
|
+
Rails.logger.debug str
|
20
21
|
end
|
21
22
|
end
|
22
23
|
|
data/lib/db_debug/middleware.rb
CHANGED
@@ -5,7 +5,9 @@ class DbDebug
|
|
5
5
|
end
|
6
6
|
|
7
7
|
def call(env)
|
8
|
-
|
8
|
+
str = env["QUERY_STRING"].gsub(/&db_debug/, "")
|
9
|
+
db_debug = env["QUERY_STRING"] != str
|
10
|
+
env["QUERY_STRING"] = str if db_debug
|
9
11
|
|
10
12
|
|
11
13
|
DbDebug.trace verbose: db_debug.present? do
|
data/lib/db_debug/version.rb
CHANGED