Skip to content

Commit

Permalink
Update IgnoredMethods for Lint/NumberConversion
Browse files Browse the repository at this point in the history
  • Loading branch information
dvandersluis committed Oct 28, 2020
1 parent 8cd2e12 commit 8ea7dc9
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@
* [#371](https://github.com/rubocop-hq/rubocop-rails/pull/371): Fix an infinite loop error for `Rails/ActiveRecordCallbacksOrder` when callbacks have inline comments. ([@fatkodima][])
* [#364](https://github.com/rubocop-hq/rubocop-rails/pull/364): Fix a problem that `Rails/UniqueValidationWithoutIndex` doesn't work in classes defined with compact style. ([@sinsoku][])

# Changes

* [rubocop-hq/rubocop#8950](https://github.com/rubocop-hq/rubocop/issues/8950): Update `IgnoredMethods` list for `Lint/NumberConversion` to allow Rails' duration methods. ([@dvandersluis][])

## 2.8.1 (2020-09-16)

### Bug fixes
Expand Down
20 changes: 20 additions & 0 deletions config/default.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,26 @@ AllCops:
# as the default.
TargetRailsVersion: ~

Lint/NumberConversion:
# Add Rails' duration methods to the ignore list for `Lint/NumberConversion`
# so that calling `to_i` on one of these does not register an offense.
IgnoredMethods:
- ago
- from_now
- second
- seconds
- minute
- minutes
- hour
- hours
- day
- days
- week
- weeks
- fortnight
- fortnights
- in_milliseconds

Rails/ActionFilter:
Description: 'Enforces consistent use of action filter methods.'
Enabled: true
Expand Down

0 comments on commit 8ea7dc9

Please sign in to comment.