File tree Expand file tree Collapse file tree 5 files changed +27
-6
lines changed Expand file tree Collapse file tree 5 files changed +27
-6
lines changed Original file line number Diff line number Diff line change 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 ] [ ] )
Original file line number Diff line number Diff line change @@ -2,6 +2,6 @@ name: rubocop-rails
22title : 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 '
66nav :
77 - modules/ROOT/nav.adoc
Original file line number Diff line number Diff 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
244244book.update_attributes!(author: 'Alice')
245245
246- #good
246+ # good
247247book.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
18451845Rails.logger.debug "The time is #{Time.zone.now}."
18461846
1847- #good
1847+ # good
18481848Rails.logger.debug { "The time is #{Time.zone.now}." }
18491849----
18501850
@@ -4346,6 +4346,13 @@ end
43464346
43474347Detect 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
43514358This cop is unsafe for autocorrection if the receiver for `all` is not an Active Record object.
Original file line number Diff line number Diff 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
Original file line number Diff line number Diff line change 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
You can’t perform that action at this time.
0 commit comments