marginalia 1.7.0 → 1.7.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/marginalia.rb +1 -1
- data/marginalia.gemspec +1 -1
- data/test/query_comments_test.rb +7 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 652f9d4885b38bec5a45af1fe9a6e2b32b2d0efe
|
4
|
+
data.tar.gz: 9f11163229b538432b7128497066dd8de3d7f06b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 338835145956ad4a5b83c73f0587d08646d6828377afe51ea6af8e5ec903bd6451c936114fd47fbd7191c8f20a5fba997f66bcc06e550125cb9ed33b230d7ec3
|
7
|
+
data.tar.gz: 0233a2cb61340a679f96fa9119e9c382121074c3b8874821e96b52952cee4c59c88a6f1efd7a983dbf9527b0e694f31f44dfb83e7ee74079eb40a0564bff5812
|
data/lib/marginalia.rb
CHANGED
@@ -52,7 +52,7 @@ module Marginalia
|
|
52
52
|
sql = "#{sql} /*#{comment}*/"
|
53
53
|
end
|
54
54
|
inline_comment = Marginalia::Comment.construct_inline_comment
|
55
|
-
if inline_comment.present?
|
55
|
+
if inline_comment.present? && !sql.include?(inline_comment)
|
56
56
|
sql = "#{sql} /*#{inline_comment}*/"
|
57
57
|
end
|
58
58
|
sql
|
data/marginalia.gemspec
CHANGED
@@ -8,7 +8,7 @@ Gem::Specification.new do |gem|
|
|
8
8
|
gem.test_files = `git ls-files -- {test}/*`.split("\n")
|
9
9
|
gem.name = "marginalia"
|
10
10
|
gem.require_paths = ["lib"]
|
11
|
-
gem.version = "1.7.
|
11
|
+
gem.version = "1.7.1"
|
12
12
|
gem.license = "MIT"
|
13
13
|
|
14
14
|
gem.add_runtime_dependency "actionpack", ">= 2.3"
|
data/test/query_comments_test.rb
CHANGED
@@ -341,6 +341,13 @@ class MarginaliaTest < MiniTest::Test
|
|
341
341
|
assert_match %r{/\*; DROP TABLE USERS;\*/$}, @queries.last
|
342
342
|
end
|
343
343
|
|
344
|
+
def test_inline_annotations_are_deduped
|
345
|
+
Marginalia.with_annotation("foo") do
|
346
|
+
ActiveRecord::Base.connection.execute "select id from posts /*foo*/"
|
347
|
+
end
|
348
|
+
assert_match %r{select id from posts /\*foo\*/ /\*application:rails\*/$}, @queries.first
|
349
|
+
end
|
350
|
+
|
344
351
|
def teardown
|
345
352
|
Marginalia.application_name = nil
|
346
353
|
Marginalia::Comment.lines_to_ignore = nil
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: marginalia
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.7.
|
4
|
+
version: 1.7.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Noah Lorang
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2019-03-
|
13
|
+
date: 2019-03-19 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: actionpack
|