Skip to content

Commit e346e6f

Browse files
committed
Cut 2.13.1
1 parent 3552dd2 commit e346e6f

File tree

5 files changed

+31
-2
lines changed

5 files changed

+31
-2
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
## master (unreleased)
44

5+
## 2.13.1 (2022-01-10)
6+
57
### Bug fixes
68

79
* [#601](https://github.com/rubocop/rubocop-rails/pull/601): Handle ignored_columns from mixins for `Rails/UnusedIgnoredColumns` cop. ([@tachyons][])

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: master
5+
version: '2.13'
66
nav:
77
- modules/ROOT/nav.adoc

docs/modules/ROOT/pages/cops_rails.adoc

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3439,6 +3439,10 @@ an `ActiveModel::MissingAttributeError`.
34393439
Explicitly raising an error in this situation is preferable, and that
34403440
is why rubocop recommends using square brackets.
34413441

3442+
When called from within a method with the same name as the attribute,
3443+
`read_attribute` and `write_attribute` must be used to prevent an
3444+
infinite loop:
3445+
34423446
=== Examples
34433447

34443448
[source,ruby]
@@ -3452,6 +3456,14 @@ x = self[:attr]
34523456
self[:attr] = val
34533457
----
34543458

3459+
[source,ruby]
3460+
----
3461+
# good
3462+
def foo
3463+
bar || read_attribute(:foo)
3464+
end
3465+
----
3466+
34553467
=== Configurable attributes
34563468

34573469
|===

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.13.0'
7+
STRING = '2.13.1'
88

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

relnotes/v2.13.1.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
### Bug fixes
2+
3+
* [#601](https://github.com/rubocop/rubocop-rails/pull/601): Handle ignored_columns from mixins for `Rails/UnusedIgnoredColumns` cop. ([@tachyons][])
4+
* [#603](https://github.com/rubocop/rubocop-rails/issues/603): Fix autocorrection of multiple attributes for `Rails/RedundantPresenceValidationOnBelongsTo` cop. ([@pirj][])
5+
* [#608](https://github.com/rubocop/rubocop-rails/issues/608): Fix autocorrection of strict validation for `Rails/RedundantPresenceValidationOnBelongsTo` cop. ([@pirj][])
6+
7+
### Changes
8+
9+
* [#585](https://github.com/rubocop/rubocop-rails/pull/585): Make `Rails/ReadWriteAttribute` cop aware of shadowing methods. ([@drenmi][])
10+
* [#604](https://github.com/rubocop/rubocop-rails/issues/604): Remove `remove_reference` and `remove_belongs_to` methods from `Rails/ReversibleMigration` cop offenses. ([@TonyArra][])
11+
12+
[@tachyons]: https://github.com/tachyons
13+
[@pirj]: https://github.com/pirj
14+
[@drenmi]: https://github.com/drenmi
15+
[@TonyArra]: https://github.com/TonyArra

0 commit comments

Comments
 (0)