rubocop-schema 0.1.2 → 0.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/rubocop/cop/style/schema_comments.rb +8 -3
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bc2a0828697c79c651b1bb9959ed0ce2dea33f11
|
4
|
+
data.tar.gz: 96fa66b35744da662a32b79b18a54add6f500228
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0dacdbc89a25569a6bd6d063e40b0abdb76cf01486b6898c8d508f6052b0c05cbc1e1b1d799d60bec2666b05cc5d38ad9642fea0afd3b95a7c02e392d67fa48d
|
7
|
+
data.tar.gz: f29d80148a69f380933a74aabebc7b87009e41623a6487331e140093dd8948212c1b3966aad4031552e3b2dc4de758230b3844ed39b70db517f8fa1e04e2f8e4
|
@@ -1,3 +1,4 @@
|
|
1
|
+
# frozen_string_literal: true
|
1
2
|
module RuboCop
|
2
3
|
module Cop
|
3
4
|
module Style
|
@@ -9,8 +10,13 @@ module RuboCop
|
|
9
10
|
COMMON_DB_FIELDS = %w("deleted_at" "id" "creator_id" "deleter_id" "created_at" "updated_at").freeze
|
10
11
|
|
11
12
|
def on_block(node)
|
12
|
-
node.body.each_child_node do |
|
13
|
-
|
13
|
+
node.body.each_child_node do |table|
|
14
|
+
# skip add_foreign_key, add_index
|
15
|
+
if table.type == :block && table.send_node.source.start_with?("create_table")
|
16
|
+
table.body.each_child_node do |ancestor|
|
17
|
+
process_block_child_node(ancestor)
|
18
|
+
end
|
19
|
+
end
|
14
20
|
end
|
15
21
|
end
|
16
22
|
|
@@ -30,4 +36,3 @@ module RuboCop
|
|
30
36
|
end
|
31
37
|
end
|
32
38
|
end
|
33
|
-
|