diff --git a/.rubocop.yml b/.rubocop.yml index 2007b91dc..dc61db8c8 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -725,6 +725,9 @@ Style/ClassVars: Style/CollectionMethods: Enabled: true +Style/ComparableBetween: + Enabled: true + Style/DigChain: Enabled: true diff --git a/app/models/poll.rb b/app/models/poll.rb index 8b6ec8624..68c15face 100644 --- a/app/models/poll.rb +++ b/app/models/poll.rb @@ -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)