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.
@@ -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
- Rails.logger.debug str
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
 
@@ -5,7 +5,9 @@ class DbDebug
5
5
  end
6
6
 
7
7
  def call(env)
8
- db_debug = env["QUERY_STRING"].gsub!(/&db_debug/, "")
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
@@ -1,3 +1,3 @@
1
1
  class DbDebug
2
- VERSION = "0.0.5"
2
+ VERSION = "0.0.6"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: db_debug
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5
4
+ version: 0.0.6
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: