diff --git a/CHANGELOG.md b/CHANGELOG.md index eeb675c6df..290d916bb5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,8 @@ ## master (unreleased) +## 2.21.2 (2023-09-30) + ### Bug fixes * [#1126](https://github.com/rubocop/rubocop-rails/pull/1126): Fix a false positive for `Rails/RedundantActiveRecordAllMethod` when using some `Enumerable`'s methods with block argument. ([@koic][]) diff --git a/docs/antora.yml b/docs/antora.yml index 9e0ff48acb..a5c58943de 100644 --- a/docs/antora.yml +++ b/docs/antora.yml @@ -2,6 +2,6 @@ name: rubocop-rails title: RuboCop Rails # We always provide version without patch here (e.g. 1.1), # as patch versions should not appear in the docs. -version: ~ +version: '2.21' nav: - modules/ROOT/nav.adoc diff --git a/docs/modules/ROOT/pages/cops_rails.adoc b/docs/modules/ROOT/pages/cops_rails.adoc index 01133267c7..c328af841f 100644 --- a/docs/modules/ROOT/pages/cops_rails.adoc +++ b/docs/modules/ROOT/pages/cops_rails.adoc @@ -4324,6 +4324,25 @@ users.where(id: ids) user.articles.order(:created_at) ---- +==== AllowedReceivers: ['ActionMailer::Preview', 'ActiveSupport::TimeZone'] (default) + +[source,ruby] +---- +# good +ActionMailer::Preview.all.first +ActiveSupport::TimeZone.all.first +---- + +=== Configurable attributes + +|=== +| Name | Default value | Configurable values + +| AllowedReceivers +| `ActionMailer::Preview`, `ActiveSupport::TimeZone` +| Array +|=== + === References * https://rails.rubystyle.guide/#redundant-all @@ -6571,7 +6590,7 @@ end | Pending | Yes -| Yes +| No | 2.21 | - |=== @@ -6590,8 +6609,8 @@ render 'foo', status: :continue render status: 100, plain: 'Ruby!' # good -render status: :continue -render status: 100 +head :continue +head 100 ---- === Configurable attributes diff --git a/lib/rubocop/rails/version.rb b/lib/rubocop/rails/version.rb index 76ac997773..9e9f054da0 100644 --- a/lib/rubocop/rails/version.rb +++ b/lib/rubocop/rails/version.rb @@ -4,7 +4,7 @@ module RuboCop module Rails # This module holds the RuboCop Rails version information. module Version - STRING = '2.21.1' + STRING = '2.21.2' def self.document_version STRING.match('\d+\.\d+').to_s diff --git a/relnotes/v2.21.2.md b/relnotes/v2.21.2.md new file mode 100644 index 0000000000..b6bb966b43 --- /dev/null +++ b/relnotes/v2.21.2.md @@ -0,0 +1,11 @@ +### Bug fixes + +* [#1126](https://github.com/rubocop/rubocop-rails/pull/1126): Fix a false positive for `Rails/RedundantActiveRecordAllMethod` when using some `Enumerable`'s methods with block argument. ([@koic][]) +* [#1121](https://github.com/rubocop/rubocop-rails/issues/1121): Fix an error for `Rails/SelectMap` when using `select(:column_name).map(&:column_name)` without receiver model. ([@koic][]) +* [#1119](https://github.com/rubocop/rubocop-rails/issues/1119): Fix an incorrect autocorrect for `Rails/RedundantActiveRecordAllMethod` when `all` has parentheses. ([@masato-bkn][]) +* [#1130](https://github.com/rubocop/rubocop-rails/issues/1130): Fix crash for `Rails/UniqueValidationWithoutIndex` with bare validate. ([@jamiemccarthy][]) +* [#1124](https://github.com/rubocop/rubocop-rails/issues/1124): Fix false positives for `Rails/RedundantActiveRecordAllMethod` when receiver is not an Active Record model. ([@koic][]) + +[@koic]: https://github.com/koic +[@masato-bkn]: https://github.com/masato-bkn +[@jamiemccarthy]: https://github.com/jamiemccarthy