From fda7a43f8e49d2b200c423eac073ee0a36bfdf72 Mon Sep 17 00:00:00 2001 From: Koichi ITO Date: Sat, 30 Sep 2023 14:28:04 +0900 Subject: [PATCH] Cut 2.21.2 --- CHANGELOG.md | 2 ++ docs/antora.yml | 2 +- docs/modules/ROOT/pages/cops_rails.adoc | 25 ++++++++++++++++++++++--- lib/rubocop/rails/version.rb | 2 +- relnotes/v2.21.2.md | 11 +++++++++++ 5 files changed, 37 insertions(+), 5 deletions(-) create mode 100644 relnotes/v2.21.2.md 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