Skip to content

Commit

Permalink
Cut 2.26.1
Browse files Browse the repository at this point in the history
  • Loading branch information
koic committed Sep 7, 2024
1 parent 22bc59e commit 6d6fca2
Show file tree
Hide file tree
Showing 6 changed files with 36 additions and 5 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.26.1 (2024-09-07)

### Bug fixes

* [#1343](https://github.com/rubocop/rubocop-rails/issues/1343): Fix false negatives for `Rails/EnumSyntax` for non-literal mappings. ([@earlopain][])
Expand Down
2 changes: 1 addition & 1 deletion config/default.yml
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ Rails/ApplicationRecord:
Enabled: true
SafeAutoCorrect: false
VersionAdded: '0.49'
VersionChanged: '<<next>>'
VersionChanged: '2.26'
Exclude:
- db/**/*.rb

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.26'
nav:
- modules/ROOT/nav.adoc
21 changes: 19 additions & 2 deletions docs/modules/ROOT/pages/cops_rails.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -612,11 +612,15 @@ end
| Yes
| Always (Unsafe)
| 0.49
| 2.5
| 2.26
|===
Checks that models subclass `ApplicationRecord` with Rails 5.0.
It is a common practice to define models inside migrations in order to retain forward
compatibility by avoiding loading any application code. And so migration files are excluded
by default for this cop.
=== Safety
This cop's autocorrection is unsafe because it may let the logic from `ApplicationRecord`
Expand All @@ -638,6 +642,16 @@ class Rails4Model < ActiveRecord::Base
end
----
=== Configurable attributes
|===
| Name | Default value | Configurable values
| Exclude
| `+db/**/*.rb+`
| Array
|===
== Rails/ArelStar
|===
Expand Down Expand Up @@ -4178,7 +4192,7 @@ core extensions to the numeric classes.
3.day.ago
1.months.ago
5.megabyte
1.gigabyte
1.gigabytes
# good
3.days.ago
Expand Down Expand Up @@ -5458,6 +5472,8 @@ File.read(Rails.root.join('db', 'schema.rb'))
File.binread(Rails.root.join('db', 'schema.rb'))
File.write(Rails.root.join('db', 'schema.rb'), content)
File.binwrite(Rails.root.join('db', 'schema.rb'), content)
Dir.glob(Rails.root.join('db', 'schema.rb'))
Dir[Rails.root.join('db', 'schema.rb')]
# good
Rails.root.join('db', 'schema.rb').open
Expand All @@ -5466,6 +5482,7 @@ Rails.root.join('db', 'schema.rb').read
Rails.root.join('db', 'schema.rb').binread
Rails.root.join('db', 'schema.rb').write(content)
Rails.root.join('db', 'schema.rb').binwrite(content)
Rails.root.glob("db/schema.rb")
----
== Rails/RootPublicPath
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.26.0'
STRING = '2.26.1'

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

* [#1343](https://github.com/rubocop/rubocop-rails/issues/1343): Fix false negatives for `Rails/EnumSyntax` for non-literal mappings. ([@earlopain][])
* [#1340](https://github.com/rubocop/rubocop-rails/issues/1340): Fix a false positive for `Rails/WhereEquals`, `Rails/WhereNot`, and `Rails/WhereRange` when qualifying the database name. ([@earlopain][])

### Changes

* [#1342](https://github.com/rubocop/rubocop-rails/issues/1342): Change `Rails/ApplicationRecord` to ignore migrations. ([@fatkodima][])
* [#1350](https://github.com/rubocop/rubocop-rails/pull/1350): Change `Rails/EnumSyntax` to autocorrect underscored options. ([@fatkodima][])

[@earlopain]: https://github.com/earlopain
[@fatkodima]: https://github.com/fatkodima

0 comments on commit 6d6fca2

Please sign in to comment.