active_record-sql_analyzer 0.2.1 → 0.2.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: cb06e648d1ffd4dea8993e522956e1f51e3a6c22
4
- data.tar.gz: acfdcbbe3ee535851f8ae9ad7d7fbc93570733ce
3
+ metadata.gz: 36199dbc04d9d0e4e4a9cf5c936676acb546e091
4
+ data.tar.gz: 36d99d4c4c1bc6e897c28c2e83903e831fb70249
5
5
  SHA512:
6
- metadata.gz: 5dc33540413a834ad211c77e473bf78de5dce8cb3fcf2221fe8c8d140249f2787d7bb6ed9961d106b5d123bb6bbb81eaec3cca02578ff29392ba80c67425c833
7
- data.tar.gz: c15a89ef7b0e5ecd94d855dcde852554f34b2f08fea6fea924c9efc453c2c122ad6db32dce65f72f63a87e8e74603aaa860fb85d9bc7d3e33364aa51b3847807
6
+ metadata.gz: 1e87e40d478a83c12e849df385cf4d98d4275d62793c25ad2253b24cd8a5b28608945fa1890c95d946d1400e6c0327457a16d85a8b9e5079bd19c2e21b335913
7
+ data.tar.gz: 528b59ab97b3c4225a371cd8fd056e46cfa8253a2df5f9b404c9dda3ce02c2e4c1b1d1c090945729da9adde9033c7678adcdb9d703af3fe4413c62bcfb99afc5
@@ -27,6 +27,8 @@ module ActiveRecord
27
27
  kaller.first
28
28
  end
29
29
 
30
+ return '' unless kaller
31
+
30
32
  config[:backtrace_redactors].each do |redactor|
31
33
  kaller.gsub!(redactor.search, redactor.replace)
32
34
  end
@@ -1,5 +1,5 @@
1
1
  module ActiveRecord
2
2
  module SqlAnalyzer
3
- VERSION = '0.2.1'
3
+ VERSION = '0.2.2'
4
4
  end
5
5
  end
@@ -98,7 +98,6 @@ RSpec.describe ActiveRecord::SqlAnalyzer::RedactedLogger do
98
98
  end
99
99
  end
100
100
 
101
-
102
101
  context "sql escaped and quoted" do
103
102
  let(:event) do
104
103
  {
@@ -263,5 +262,20 @@ RSpec.describe ActiveRecord::SqlAnalyzer::RedactedLogger do
263
262
  expect(filter_event[:sql]).to eq("INSERT INTO `boom` (REDACTED_COLUMNS) VALUES ('[REDACTED]')")
264
263
  end
265
264
  end
265
+
266
+ context "empty callstack" do
267
+ let(:event) do
268
+ {
269
+ calls: [{
270
+ caller: [],
271
+ sql: "INSERT INTO `boom` (`bam`, `foo`) VALUES ('howdy', 'dowdy')",
272
+ }]
273
+ }
274
+ end
275
+
276
+ it "redacts" do
277
+ expect(filter_event[:caller]).to eq("")
278
+ end
279
+ end
266
280
  end
267
281
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: active_record-sql_analyzer
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Zachary Anker
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2016-08-18 00:00:00.000000000 Z
12
+ date: 2016-09-19 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: activerecord
@@ -110,7 +110,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
110
110
  version: '0'
111
111
  requirements: []
112
112
  rubyforge_project:
113
- rubygems_version: 2.5.1
113
+ rubygems_version: 2.6.6
114
114
  signing_key:
115
115
  specification_version: 4
116
116
  summary: Logs a subset of ActiveRecord queries and dumps them for analyses.