Add and apply Style/ComparableBetween RuboCop rule
This rule was introduced in RuboCop 1.74 to prefer using between? over chained comparison operators.
This commit is contained in:
@@ -725,6 +725,9 @@ Style/ClassVars:
|
||||
Style/CollectionMethods:
|
||||
Enabled: true
|
||||
|
||||
Style/ComparableBetween:
|
||||
Enabled: true
|
||||
|
||||
Style/DigChain:
|
||||
Enabled: true
|
||||
|
||||
|
||||
@@ -116,7 +116,7 @@ class Poll < ApplicationRecord
|
||||
end
|
||||
|
||||
def current?(timestamp = Time.current)
|
||||
starts_at <= timestamp && timestamp <= ends_at
|
||||
timestamp.between?(starts_at, ends_at)
|
||||
end
|
||||
|
||||
def expired?(timestamp = Time.current)
|
||||
|
||||
Reference in New Issue
Block a user