Skip to content

Commit

Permalink
Cut 2.13.1
Browse files Browse the repository at this point in the history
  • Loading branch information
koic committed Jan 9, 2022
1 parent 3552dd2 commit e346e6f
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 2 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

## master (unreleased)

## 2.13.1 (2022-01-10)

### Bug fixes

* [#601](https://github.com/rubocop/rubocop-rails/pull/601): Handle ignored_columns from mixins for `Rails/UnusedIgnoredColumns` cop. ([@tachyons][])
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: master
version: '2.13'
nav:
- modules/ROOT/nav.adoc
12 changes: 12 additions & 0 deletions docs/modules/ROOT/pages/cops_rails.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -3439,6 +3439,10 @@ an `ActiveModel::MissingAttributeError`.
Explicitly raising an error in this situation is preferable, and that
is why rubocop recommends using square brackets.

When called from within a method with the same name as the attribute,
`read_attribute` and `write_attribute` must be used to prevent an
infinite loop:

=== Examples

[source,ruby]
Expand All @@ -3452,6 +3456,14 @@ x = self[:attr]
self[:attr] = val
----

[source,ruby]
----
# good
def foo
bar || read_attribute(:foo)
end
----

=== Configurable attributes

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

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

* [#601](https://github.com/rubocop/rubocop-rails/pull/601): Handle ignored_columns from mixins for `Rails/UnusedIgnoredColumns` cop. ([@tachyons][])
* [#603](https://github.com/rubocop/rubocop-rails/issues/603): Fix autocorrection of multiple attributes for `Rails/RedundantPresenceValidationOnBelongsTo` cop. ([@pirj][])
* [#608](https://github.com/rubocop/rubocop-rails/issues/608): Fix autocorrection of strict validation for `Rails/RedundantPresenceValidationOnBelongsTo` cop. ([@pirj][])

### Changes

* [#585](https://github.com/rubocop/rubocop-rails/pull/585): Make `Rails/ReadWriteAttribute` cop aware of shadowing methods. ([@drenmi][])
* [#604](https://github.com/rubocop/rubocop-rails/issues/604): Remove `remove_reference` and `remove_belongs_to` methods from `Rails/ReversibleMigration` cop offenses. ([@TonyArra][])

[@tachyons]: https://github.com/tachyons
[@pirj]: https://github.com/pirj
[@drenmi]: https://github.com/drenmi
[@TonyArra]: https://github.com/TonyArra

0 comments on commit e346e6f

Please sign in to comment.