rubocop-rails 2.22.0 → 2.22.1

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: 04c91e90b833ac948b90250b28d11aa4800aae35a8b30a6e70f80f21b69f6f3b
4
- data.tar.gz: ff6f1a9257f9bb1e1a49e7ff099de9ae138cea69ae3b50c02cccad5872d2040a
3
+ metadata.gz: a4d08f111893c16ea5c725b8da3b488a85d193366cdec6c876e780e794d66ba3
4
+ data.tar.gz: 40bd526fbf58ea8b3b45ab82ff5b7f809dcf29c7377991023fb30157dc66cc0d
5
5
  SHA512:
6
- metadata.gz: f4033f539ef9bf1282b0ac5a81d026c683dd618f7a367b59e03117be1092a790f4df71a26b304ea4399c484d9a0c2af31987d8d9f793b822f570ab24df614477
7
- data.tar.gz: 0aec6e0248f966e706460fa9796831d2617f04b371a1d37531e9dd52938278e59802b804d7320aec7bfd3677cfe01f55600cb4a5fd07c3c2e4ff68542e2a78fa
6
+ metadata.gz: 6dd91e7f4068bba386e8b66ce86ec18961bc6e346d000947220af3fccdaf076907a11d7367786702124370aa070aacadba96bde0c200303ad64eaf1b5de6f8d5
7
+ data.tar.gz: 783d1a9013524550b3bbd2271f3d244b13565038b1f0e73b7726565a6ea79e6e409b19f748e043fd7d850c623ea3f56c831f81f7d5bafd2cbd5e08d4181b1172
data/README.md CHANGED
@@ -82,7 +82,7 @@ module YourCoolApp
82
82
  end
83
83
  ```
84
84
 
85
- It uses `rubocop -A` to apply `Style/FrozenStringLiteralComment` and other unsafe autocorretion cops.
85
+ It uses `rubocop -A` to apply `Style/FrozenStringLiteralComment` and other unsafe autocorrection cops.
86
86
  `rubocop -A` is unsafe autocorrection, but code generated by default is simple and less likely to
87
87
  be incompatible with `rubocop -A`. If you have problems you can replace it with `rubocop -a` instead.
88
88
 
@@ -9,7 +9,7 @@ module RuboCop
9
9
  # something_filter methods or the newer something_action methods.
10
10
  #
11
11
  # IMPORTANT: This cop is deprecated. Because the `*_filter` methods were removed in Rails 4.2,
12
- # and that Rals version is no longer supported by RuboCop Rails. This cop will be removed in RuboCop Rails 3.0.
12
+ # and that Rails version is no longer supported by RuboCop Rails. This cop will be removed in RuboCop Rails 3.0.
13
13
  #
14
14
  # @example EnforcedStyle: action (default)
15
15
  # # bad
@@ -21,12 +21,12 @@ module RuboCop
21
21
  # has_one :foo
22
22
  #
23
23
  # # bad
24
- # belongs_to :foo, class_name: 'Foo'
25
- # belongs_to :bar, class_name: 'Foo'
24
+ # has_many :foo, class_name: 'Foo'
25
+ # has_many :bar, class_name: 'Foo'
26
26
  # has_one :baz
27
27
  #
28
28
  # # good
29
- # belongs_to :bar, class_name: 'Foo'
29
+ # has_many :bar, class_name: 'Foo'
30
30
  # has_one :foo
31
31
  #
32
32
  class DuplicateAssociation < Base
@@ -87,7 +87,8 @@ module RuboCop
87
87
  end
88
88
 
89
89
  def duplicated_class_name_nodes(association_nodes)
90
- grouped_associations = association_nodes.group_by do |node|
90
+ filtered_nodes = association_nodes.reject { |node| node.method?(:belongs_to) }
91
+ grouped_associations = filtered_nodes.group_by do |node|
91
92
  arguments = association(node).last
92
93
  next unless arguments.count == 1
93
94
 
@@ -4,7 +4,7 @@ module RuboCop
4
4
  module Rails
5
5
  # This module holds the RuboCop Rails version information.
6
6
  module Version
7
- STRING = '2.22.0'
7
+ STRING = '2.22.1'
8
8
 
9
9
  def self.document_version
10
10
  STRING.match('\d+\.\d+').to_s
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rubocop-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.22.0
4
+ version: 2.22.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Bozhidar Batsov
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2023-10-27 00:00:00.000000000 Z
13
+ date: 2023-10-28 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: activesupport