rubocop-migration 0.4.1 → 0.4.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +5 -5
- data/README.md +1 -1
- data/lib/rubocop/cop/migration/remove_column.rb +7 -4
- data/lib/rubocop/migration/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 18f0c1b4fa8be61ca159b11acf5593b9343c4696156171acb9ba5774c422dfab
|
4
|
+
data.tar.gz: 7fd0e0b48fc9d98d1ba4a307a1bb41fbd8068240710954c0bf69e3aedb0c5d9c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: '090d29334bcef597b4b9a13f63b9b79494ef0190f458814ea01abeb8d0d48a374b58a60619f06b85737d258ebda0065647f91e96cb98601e0dd53a4847e494ea'
|
7
|
+
data.tar.gz: f7992c9b8468c881508f5aaa091187c75f432368ba0f2e7c4db014fe81f233524c1536b184c067efdab12933ad0a3e0278f5ff3425120d29dc713d8b1478e6ad
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
rubocop-migration (0.4.
|
4
|
+
rubocop-migration (0.4.2)
|
5
5
|
activesupport
|
6
6
|
rubocop (>= 1.34)
|
7
7
|
rubocop-rails
|
@@ -9,7 +9,7 @@ PATH
|
|
9
9
|
GEM
|
10
10
|
remote: https://rubygems.org/
|
11
11
|
specs:
|
12
|
-
activesupport (7.0.
|
12
|
+
activesupport (7.0.6)
|
13
13
|
concurrent-ruby (~> 1.0, >= 1.0.2)
|
14
14
|
i18n (>= 1.6, < 2)
|
15
15
|
minitest (>= 5.1)
|
@@ -20,11 +20,11 @@ GEM
|
|
20
20
|
i18n (1.14.1)
|
21
21
|
concurrent-ruby (~> 1.0)
|
22
22
|
json (2.6.2)
|
23
|
-
minitest (5.18.
|
23
|
+
minitest (5.18.1)
|
24
24
|
parallel (1.22.1)
|
25
25
|
parser (3.1.2.1)
|
26
26
|
ast (~> 2.4.1)
|
27
|
-
rack (3.0.
|
27
|
+
rack (3.0.8)
|
28
28
|
rainbow (3.1.1)
|
29
29
|
rake (13.0.6)
|
30
30
|
regexp_parser (2.6.0)
|
@@ -57,7 +57,7 @@ GEM
|
|
57
57
|
rubocop-performance (1.15.0)
|
58
58
|
rubocop (>= 1.7.0, < 2.0)
|
59
59
|
rubocop-ast (>= 0.4.0)
|
60
|
-
rubocop-rails (2.
|
60
|
+
rubocop-rails (2.20.2)
|
61
61
|
activesupport (>= 4.2.0)
|
62
62
|
rack (>= 1.1)
|
63
63
|
rubocop (>= 1.33.0, < 2.0)
|
data/README.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# rubocop-migration
|
2
2
|
|
3
|
-
[![
|
3
|
+
[![ci](https://github.com/r7kamura/rubocop-migration/actions/workflows/ci.yml/badge.svg)](https://github.com/r7kamura/rubocop-migration/actions/workflows/ci.yml)
|
4
4
|
|
5
5
|
RuboCop extension focused on ActiveRecord migration.
|
6
6
|
|
@@ -135,15 +135,18 @@ module RuboCop
|
|
135
135
|
# @param node [RuboCop::AST::SendNode]
|
136
136
|
# @return [String, nil]
|
137
137
|
def find_table_name_from(node)
|
138
|
-
node.arguments[0]
|
138
|
+
table_name_node = node.arguments[0]
|
139
|
+
table_name_node.value&.to_s if table_name_node.respond_to?(:value)
|
139
140
|
end
|
140
141
|
|
142
|
+
# @note This method returns `true` if the table name cannot be determined.
|
141
143
|
# @param node [RuboCop::AST::SendNode]
|
142
144
|
# @return [Boolean]
|
143
145
|
def ignored?(node)
|
144
|
-
|
145
|
-
|
146
|
-
|
146
|
+
table_name = find_table_name_from(node)
|
147
|
+
return true unless table_name
|
148
|
+
|
149
|
+
find_ignored_column_names_from(table_name).include?(
|
147
150
|
find_column_name_from(node)
|
148
151
|
)
|
149
152
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rubocop-migration
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ryo Nakamura
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-
|
11
|
+
date: 2023-07-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|