diff --git a/CHANGELOG.md b/CHANGELOG.md index 3e1a284726..02794be454 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/config/default.yml b/config/default.yml index f8fd0f542a..aba10c768d 100644 --- a/config/default.yml +++ b/config/default.yml @@ -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