Skip to content

Commit b8409c1

Browse files
committed
Cut 2.25.1
1 parent 7a2b993 commit b8409c1

File tree

6 files changed

+44
-7
lines changed

6 files changed

+44
-7
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.25.1 (2024-06-29)
13+
1214
### Bug fixes
1315

1416
* [#1280](https://github.com/rubocop/rubocop-rails/issues/1280): Look for change_column_null for `Rails/BulkChangeTable`. ([@ccutrer][])

config/default.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1020,7 +1020,7 @@ Rails/SkipsModelValidations:
10201020
Enabled: true
10211021
Safe: false
10221022
VersionAdded: '0.47'
1023-
VersionChanged: '<<next>>'
1023+
VersionChanged: '2.25'
10241024
ForbiddenMethods:
10251025
- decrement!
10261026
- decrement_counter

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

docs/modules/ROOT/pages/cops_rails.adoc

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3447,7 +3447,7 @@ end
34473447
| -
34483448
|===
34493449
3450-
Checks for calls to `link_to` that contain a
3450+
Checks for calls to `link_to`, `link_to_if`, and `link_to_unless` methods that contain a
34513451
`target: '_blank'` but no `rel: 'noopener'`. This can be a security
34523452
risk as the loaded page will have control over the previous page
34533453
and could change its location for phishing purposes.
@@ -5873,10 +5873,10 @@ l Time.now
58735873
| Enabled by default | Safe | Supports autocorrection | Version Added | Version Changed
58745874
58755875
| Enabled
5876-
| Yes
5876+
| No
58775877
| No
58785878
| 0.47
5879-
| 2.7
5879+
| 2.25
58805880
|===
58815881
58825882
Checks for the use of methods which skip
@@ -5885,6 +5885,10 @@ https://guides.rubyonrails.org/active_record_validations.html#skipping-validatio
58855885
58865886
Methods may be ignored from this rule by configuring a `AllowedMethods`.
58875887
5888+
=== Safety
5889+
5890+
This cop is unsafe if the receiver object is not an Active Record object.
5891+
58885892
=== Examples
58895893
58905894
[source,ruby]
@@ -6744,6 +6748,7 @@ Checks for the use of old-style attribute validation macros.
67446748
----
67456749
# bad
67466750
validates_acceptance_of :foo
6751+
validates_comparison_of :foo
67476752
validates_confirmation_of :foo
67486753
validates_exclusion_of :foo
67496754
validates_format_of :foo
@@ -6758,6 +6763,7 @@ validates_uniqueness_of :foo
67586763
# good
67596764
validates :foo, acceptance: true
67606765
validates :foo, confirmation: true
6766+
validates :foo, comparison: true
67616767
validates :foo, exclusion: true
67626768
validates :foo, format: true
67636769
validates :foo, inclusion: true
@@ -7030,14 +7036,23 @@ NOTE: Required Ruby version: 2.6
70307036
70317037
| Pending
70327038
| Yes
7033-
| Always
7039+
| Always (Unsafe)
70347040
| 2.25
70357041
| -
70367042
|===
70377043
70387044
Identifies places where manually constructed SQL
70397045
in `where` can be replaced with ranges.
70407046
7047+
=== Safety
7048+
7049+
This cop's autocorrection is unsafe because it can change the query
7050+
by explicitly attaching the column to the wrong table.
7051+
For example, `Booking.joins(:events).where('end_at < ?', Time.current)` will correctly
7052+
implicitly attach the `end_at` column to the `events` table. But when autocorrected to
7053+
`Booking.joins(:events).where(end_at: ...Time.current)`, it will now be incorrectly
7054+
explicitly attached to the `bookings` table.
7055+
70417056
=== Examples
70427057
70437058
[source,ruby]

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.25.0'
7+
STRING = '2.25.1'
88

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

relnotes/v2.25.1.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
### Bug fixes
2+
3+
* [#1280](https://github.com/rubocop/rubocop-rails/issues/1280): Look for change_column_null for `Rails/BulkChangeTable`. ([@ccutrer][])
4+
* [#1299](https://github.com/rubocop/rubocop-rails/pull/1299): Fix an error for `Rails/NotNullColumn` when the block for `change_table` is empty. ([@earlopain][])
5+
* [#1281](https://github.com/rubocop/rubocop-rails/issues/1281): Fix `Rails/WhereRange` autocorrect for complex expressions. ([@fatkodima][])
6+
* [#1282](https://github.com/rubocop/rubocop-rails/issues/1282): Fix `Rails/WhereRange` to correctly handle template strings with extra spaces. ([@fatkodima][])
7+
8+
### Changes
9+
10+
* [#1295](https://github.com/rubocop/rubocop-rails/issues/1295): Cover validates_comparison_of in `Rails/Validation`. ([@ChaelCodes][])
11+
* [#1288](https://github.com/rubocop/rubocop-rails/issues/1288): Let `Rails/LinkToBlank` look into `link_to_if` and `link_to_unless`, too. ([@fwolfst][])
12+
* [#1286](https://github.com/rubocop/rubocop-rails/issues/1286): Mark `Rails/SkipsModelValidations` as unsafe. ([@koic][])
13+
* [#1283](https://github.com/rubocop/rubocop-rails/issues/1283): Mark `Rails/WhereRange` as unsafe autocorrect. ([@fatkodima][])
14+
15+
[@ccutrer]: https://github.com/ccutrer
16+
[@earlopain]: https://github.com/earlopain
17+
[@fatkodima]: https://github.com/fatkodima
18+
[@ChaelCodes]: https://github.com/ChaelCodes
19+
[@fwolfst]: https://github.com/fwolfst
20+
[@koic]: https://github.com/koic

0 commit comments

Comments
 (0)