Skip to content

Commit bdc741d

Browse files
committed
Cut 2.23.0
1 parent cbd9eeb commit bdc741d

File tree

5 files changed

+39
-8
lines changed

5 files changed

+39
-8
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.23.0 (2023-12-16)
13+
1214
### New features
1315

1416
* [#1183](https://github.com/rubocop/rubocop-rails/pull/1183): Support PostGIS adapter for PostgreSQL. ([@Dania02525][])

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.23'
66
nav:
77
- modules/ROOT/nav.adoc

docs/modules/ROOT/pages/cops_rails.adoc

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4014,10 +4014,13 @@ as the cop cannot replace to `select` between calls to `pluck` on an
40144014
----
40154015
# bad
40164016
Post.where(user_id: User.active.pluck(:id))
4017+
Post.where(user_id: User.active.ids)
4018+
Post.where.not(user_id: User.active.pluck(:id))
40174019
40184020
# good
40194021
Post.where(user_id: User.active.select(:id))
40204022
Post.where(user_id: active_users.select(:id))
4023+
Post.where.not(user_id: active_users.select(:id))
40214024
----
40224025

40234026
==== EnforcedStyle: conservative (default)
@@ -4346,8 +4349,7 @@ end
43464349

43474350
Detect redundant `all` used as a receiver for Active Record query methods.
43484351

4349-
NOTE: For the methods `delete_all` and `destroy_all`,
4350-
this cop will only check cases where the receiver is a model.
4352+
For the methods `delete_all` and `destroy_all`, this cop will only check cases where the receiver is a model.
43514353
It will ignore cases where the receiver is an association (e.g., `user.articles.all.delete_all`).
43524354
This is because omitting `all` from an association changes the methods
43534355
from `ActiveRecord::Relation` to `ActiveRecord::Associations::CollectionProxy`,
@@ -4984,13 +4986,14 @@ require_dependency 'some_lib'
49844986
| 2.19
49854987
|===
49864988

4987-
Prefer `response.parsed_body` to `JSON.parse(response.body)`.
4989+
Prefer `response.parsed_body` to custom parsing logic for `response.body`.
49884990

49894991
=== Safety
49904992

4991-
This cop is unsafe because Content-Type may not be `application/json`. For example, the proprietary
4992-
Content-Type provided by corporate entities such as `application/vnd.github+json` is not supported at
4993-
`response.parsed_body` by default, so you still have to use `JSON.parse(response.body)` there.
4993+
This cop is unsafe because Content-Type may not be `application/json` or `text/html`.
4994+
For example, the proprietary Content-Type provided by corporate entities such as
4995+
`application/vnd.github+json` is not supported at `response.parsed_body` by default,
4996+
so you still have to use `JSON.parse(response.body)` there.
49944997

49954998
=== Examples
49964999

@@ -4999,6 +5002,12 @@ Content-Type provided by corporate entities such as `application/vnd.github+json
49995002
# bad
50005003
JSON.parse(response.body)
50015004
5005+
# bad
5006+
Nokogiri::HTML.parse(response.body)
5007+
5008+
# bad
5009+
Nokogiri::HTML5.parse(response.body)
5010+
50025011
# good
50035012
response.parsed_body
50045013
----

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.2'
7+
STRING = '2.23.0'
88

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

relnotes/v2.23.0.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
### New features
2+
3+
* [#1183](https://github.com/rubocop/rubocop-rails/pull/1183): Support PostGIS adapter for PostgreSQL. ([@Dania02525][])
4+
5+
### Bug fixes
6+
7+
* [#1206](https://github.com/rubocop/rubocop-rails/issues/1206): Fix an error for `Rails/WhereMissing` where join method is called without arguments. ([@fatkodima][])
8+
* [#1189](https://github.com/rubocop/rubocop-rails/issues/1189): Fix false negatives for `Rails/Pluck` when using safe navigation method calls. ([@koic][])
9+
* [#1204](https://github.com/rubocop/rubocop-rails/pull/1204): Make `Rails/ActiveSupportAliases`, `Rails/FindBy`, `Rails/FindById`, `Rails/Inquiry`, `Rails/Pick` `Rails/PluckId`, `Rails/PluckInWhere`, `Rails/WhereEquals`, `Rails/WhereExists`, and `Rails/WhereNot` cops aware of safe navigation operator. ([@koic][])
10+
11+
### Changes
12+
13+
* [#1213](https://github.com/rubocop/rubocop-rails/issues/1213): Update `Rails/PluckInWhere` to check for `.ids` call. ([@fatkodima][])
14+
* [#1181](https://github.com/rubocop/rubocop-rails/pull/1181): Support `Nokogiri::HTML.parse` and `Nokogiri::HTML5.parse` on `Rails/ResponseParsedBody`. ([@r7kamura][])
15+
* [#1198](https://github.com/rubocop/rubocop-rails/issues/1198): Support `where.not` for `Rails/PluckInWhere`. ([@fatkodima][])
16+
17+
[@Dania02525]: https://github.com/Dania02525
18+
[@fatkodima]: https://github.com/fatkodima
19+
[@koic]: https://github.com/koic
20+
[@r7kamura]: https://github.com/r7kamura

0 commit comments

Comments
 (0)