Skip to content

Commit

Permalink
Cut 2.25.1
Browse files Browse the repository at this point in the history
  • Loading branch information
koic committed Jun 29, 2024
1 parent 7a2b993 commit b8409c1
Show file tree
Hide file tree
Showing 6 changed files with 44 additions and 7 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@

## master (unreleased)

## 2.25.1 (2024-06-29)

### Bug fixes

* [#1280](https://github.com/rubocop/rubocop-rails/issues/1280): Look for change_column_null for `Rails/BulkChangeTable`. ([@ccutrer][])
Expand Down
2 changes: 1 addition & 1 deletion config/default.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1020,7 +1020,7 @@ Rails/SkipsModelValidations:
Enabled: true
Safe: false
VersionAdded: '0.47'
VersionChanged: '<<next>>'
VersionChanged: '2.25'
ForbiddenMethods:
- decrement!
- decrement_counter
Expand Down
2 changes: 1 addition & 1 deletion docs/antora.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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.25'
nav:
- modules/ROOT/nav.adoc
23 changes: 19 additions & 4 deletions docs/modules/ROOT/pages/cops_rails.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -3447,7 +3447,7 @@ end
| -
|===
Checks for calls to `link_to` that contain a
Checks for calls to `link_to`, `link_to_if`, and `link_to_unless` methods that contain a
`target: '_blank'` but no `rel: 'noopener'`. This can be a security
risk as the loaded page will have control over the previous page
and could change its location for phishing purposes.
Expand Down Expand Up @@ -5873,10 +5873,10 @@ l Time.now
| Enabled by default | Safe | Supports autocorrection | Version Added | Version Changed
| Enabled
| Yes
| No
| No
| 0.47
| 2.7
| 2.25
|===
Checks for the use of methods which skip
Expand All @@ -5885,6 +5885,10 @@ https://guides.rubyonrails.org/active_record_validations.html#skipping-validatio
Methods may be ignored from this rule by configuring a `AllowedMethods`.
=== Safety
This cop is unsafe if the receiver object is not an Active Record object.
=== Examples
[source,ruby]
Expand Down Expand Up @@ -6744,6 +6748,7 @@ Checks for the use of old-style attribute validation macros.
----
# bad
validates_acceptance_of :foo
validates_comparison_of :foo
validates_confirmation_of :foo
validates_exclusion_of :foo
validates_format_of :foo
Expand All @@ -6758,6 +6763,7 @@ validates_uniqueness_of :foo
# good
validates :foo, acceptance: true
validates :foo, confirmation: true
validates :foo, comparison: true
validates :foo, exclusion: true
validates :foo, format: true
validates :foo, inclusion: true
Expand Down Expand Up @@ -7030,14 +7036,23 @@ NOTE: Required Ruby version: 2.6
| Pending
| Yes
| Always
| Always (Unsafe)
| 2.25
| -
|===
Identifies places where manually constructed SQL
in `where` can be replaced with ranges.
=== Safety
This cop's autocorrection is unsafe because it can change the query
by explicitly attaching the column to the wrong table.
For example, `Booking.joins(:events).where('end_at < ?', Time.current)` will correctly
implicitly attach the `end_at` column to the `events` table. But when autocorrected to
`Booking.joins(:events).where(end_at: ...Time.current)`, it will now be incorrectly
explicitly attached to the `bookings` table.
=== Examples
[source,ruby]
Expand Down
2 changes: 1 addition & 1 deletion lib/rubocop/rails/version.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ module RuboCop
module Rails
# This module holds the RuboCop Rails version information.
module Version
STRING = '2.25.0'
STRING = '2.25.1'

def self.document_version
STRING.match('\d+\.\d+').to_s
Expand Down
20 changes: 20 additions & 0 deletions relnotes/v2.25.1.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
### Bug fixes

* [#1280](https://github.com/rubocop/rubocop-rails/issues/1280): Look for change_column_null for `Rails/BulkChangeTable`. ([@ccutrer][])
* [#1299](https://github.com/rubocop/rubocop-rails/pull/1299): Fix an error for `Rails/NotNullColumn` when the block for `change_table` is empty. ([@earlopain][])
* [#1281](https://github.com/rubocop/rubocop-rails/issues/1281): Fix `Rails/WhereRange` autocorrect for complex expressions. ([@fatkodima][])
* [#1282](https://github.com/rubocop/rubocop-rails/issues/1282): Fix `Rails/WhereRange` to correctly handle template strings with extra spaces. ([@fatkodima][])

### Changes

* [#1295](https://github.com/rubocop/rubocop-rails/issues/1295): Cover validates_comparison_of in `Rails/Validation`. ([@ChaelCodes][])
* [#1288](https://github.com/rubocop/rubocop-rails/issues/1288): Let `Rails/LinkToBlank` look into `link_to_if` and `link_to_unless`, too. ([@fwolfst][])
* [#1286](https://github.com/rubocop/rubocop-rails/issues/1286): Mark `Rails/SkipsModelValidations` as unsafe. ([@koic][])
* [#1283](https://github.com/rubocop/rubocop-rails/issues/1283): Mark `Rails/WhereRange` as unsafe autocorrect. ([@fatkodima][])

[@ccutrer]: https://github.com/ccutrer
[@earlopain]: https://github.com/earlopain
[@fatkodima]: https://github.com/fatkodima
[@ChaelCodes]: https://github.com/ChaelCodes
[@fwolfst]: https://github.com/fwolfst
[@koic]: https://github.com/koic

0 comments on commit b8409c1

Please sign in to comment.