Skip to content

Commit

Permalink
Merge pull request #381 from dvandersluis/issue/rubocop-8950
Browse files Browse the repository at this point in the history
Update IgnoredMethods for Lint/NumberConversion
  • Loading branch information
koic authored Feb 27, 2021
2 parents ec236b1 + 6cae3bb commit 7a3f454
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
* [#416](https://github.com/rubocop/rubocop-rails/pull/416): Make `Rails/HasManyOrHasOneDependent` accept combination of association extension and `with_options`. ([@ohbarye][])
* [#432](https://github.com/rubocop/rubocop-rails/issues/432): Exclude gemspec file by default for `Rails/TimeZone` cop. ([@koic][])
* [#440](https://github.com/rubocop/rubocop-rails/issues/440): This PR makes `Rails/TimeZone` aware of timezone specifier. ([@koic][])
* [#381](https://github.com/rubocop/rubocop-rails/pull/381): Update `IgnoredMethods` list for `Lint/NumberConversion` to allow Rails' duration methods. ([@dvandersluis][])

## 2.9.1 (2020-12-16)

Expand Down
21 changes: 21 additions & 0 deletions config/default.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,27 @@ 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.
# See: https://github.com/rubocop/rubocop/issues/8950
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 7a3f454

Please sign in to comment.