rubocop-rails 2.22.0 → 2.22.1
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/README.md +1 -1
- data/lib/rubocop/cop/rails/action_filter.rb +1 -1
- data/lib/rubocop/cop/rails/duplicate_association.rb +5 -4
- data/lib/rubocop/rails/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: a4d08f111893c16ea5c725b8da3b488a85d193366cdec6c876e780e794d66ba3
|
4
|
+
data.tar.gz: 40bd526fbf58ea8b3b45ab82ff5b7f809dcf29c7377991023fb30157dc66cc0d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
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
|
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
|
-
#
|
25
|
-
#
|
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
|
-
#
|
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
|
-
|
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
|
|
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.
|
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-
|
13
|
+
date: 2023-10-28 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: activesupport
|