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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: fa5e7fda6eeffbf26f8c9bd1a4433a689416e0a2098ce9193f93c72564b8b4f2
4
- data.tar.gz: 4907939dbd5ba1a39cf76d838824bfa8574fe527b6a8985588bd7897eb5a3a1c
3
+ metadata.gz: 18f0c1b4fa8be61ca159b11acf5593b9343c4696156171acb9ba5774c422dfab
4
+ data.tar.gz: 7fd0e0b48fc9d98d1ba4a307a1bb41fbd8068240710954c0bf69e3aedb0c5d9c
5
5
  SHA512:
6
- metadata.gz: 6885d3a799806f1a3699cf892eb2a9855b66b8d29f9578fe9a0d8f98e84ab0526683710a35b22dbb1601cc6b52c015421aa163c6f671a4366ceb3d5a582dedba
7
- data.tar.gz: 8838e0d3758231c59a844e26d4b7795dd7abf74743a16f25075f9804f3de51248d2c6893614ecfdee8cdf075af46430b3723b3e10f62a57a39f42ef31b326489
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.1)
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.5)
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.0)
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.7)
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.19.1)
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
- [![test](https://github.com/r7kamura/rubocop-migration/actions/workflows/test.yml/badge.svg)](https://github.com/r7kamura/rubocop-migration/actions/workflows/test.yml)
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].value&.to_s
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
- find_ignored_column_names_from(
145
- find_table_name_from(node)
146
- ).include?(
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
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Rubocop
4
4
  module Migration
5
- VERSION = '0.4.1'
5
+ VERSION = '0.4.2'
6
6
  end
7
7
  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.1
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-06-14 00:00:00.000000000 Z
11
+ date: 2023-07-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport