Skip to content

Commit afd7bab

Browse files
committed
Cut 2.22.2
1 parent 15b97b0 commit afd7bab

File tree

5 files changed

+27
-6
lines changed

5 files changed

+27
-6
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99

1010
## master (unreleased)
1111

12+
## 2.22.2 (2023-11-19)
13+
1214
### Bug fixes
1315

1416
* [#1172](https://github.com/rubocop/rubocop-rails/issues/1172): Fix an error for `Rails/UnknownEnv` when using Rails 7.1. ([@koic][])

docs/antora.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@ name: rubocop-rails
22
title: RuboCop Rails
33
# We always provide version without patch here (e.g. 1.1),
44
# as patch versions should not appear in the docs.
5-
version: ~
5+
version: '2.22'
66
nav:
77
- modules/ROOT/nav.adoc

docs/modules/ROOT/pages/cops_rails.adoc

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -240,10 +240,10 @@ This cop is unsafe because custom `update_attributes` method call was changed to
240240

241241
[source,ruby]
242242
----
243-
#bad
243+
# bad
244244
book.update_attributes!(author: 'Alice')
245245
246-
#good
246+
# good
247247
book.update!(author: 'Alice')
248248
----
249249

@@ -1841,10 +1841,10 @@ when no output would be produced anyway.
18411841

18421842
[source,ruby]
18431843
----
1844-
#bad
1844+
# bad
18451845
Rails.logger.debug "The time is #{Time.zone.now}."
18461846
1847-
#good
1847+
# good
18481848
Rails.logger.debug { "The time is #{Time.zone.now}." }
18491849
----
18501850

@@ -4346,6 +4346,13 @@ end
43464346

43474347
Detect redundant `all` used as a receiver for Active Record query methods.
43484348

4349+
NOTE: For the methods `delete_all` and `destroy_all`,
4350+
this cop will only check cases where the receiver is a model.
4351+
It will ignore cases where the receiver is an association (e.g., `user.articles.all.delete_all`).
4352+
This is because omitting `all` from an association changes the methods
4353+
from `ActiveRecord::Relation` to `ActiveRecord::Associations::CollectionProxy`,
4354+
which can affect their behavior.
4355+
43494356
=== Safety
43504357

43514358
This cop is unsafe for autocorrection if the receiver for `all` is not an Active Record object.

lib/rubocop/rails/version.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ module RuboCop
44
module Rails
55
# This module holds the RuboCop Rails version information.
66
module Version
7-
STRING = '2.22.1'
7+
STRING = '2.22.2'
88

99
def self.document_version
1010
STRING.match('\d+\.\d+').to_s

relnotes/v2.22.2.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
### Bug fixes
2+
3+
* [#1172](https://github.com/rubocop/rubocop-rails/issues/1172): Fix an error for `Rails/UnknownEnv` when using Rails 7.1. ([@koic][])
4+
* [#1173](https://github.com/rubocop/rubocop-rails/issues/1173): Fix an error for `Rails/RedundantActiveRecordAllMethod` cop when used with RuboCop 1.51 or lower. ([@koic][])
5+
6+
### Changes
7+
8+
* [#1171](https://github.com/rubocop/rubocop-rails/pull/1171): Change `Rails/RedundantActiveRecordAllMethod` to ignore `delete_all` and `destroy_all` when receiver is an association. ([@masato-bkn][])
9+
* [#1178](https://github.com/rubocop/rubocop-rails/pull/1178): Require RuboCop AST 1.30.0+. ([@koic][])
10+
11+
[@koic]: https://github.com/koic
12+
[@masato-bkn]: https://github.com/masato-bkn

0 commit comments

Comments
 (0)