mirror of
https://github.com/openSUSE/osem.git
synced 2026-08-13 19:54:02 +00:00
voting period is open when voting dates are not set
This commit is contained in:
parent
d07de3ca88
commit
ea868d4cc7
3 changed files with 6 additions and 6 deletions
|
|
@ -72,16 +72,16 @@ class Program < ActiveRecord::Base
|
|||
def show_voting?
|
||||
return true unless blind_voting
|
||||
|
||||
Date.today > voting_end_date
|
||||
Time.current > voting_end_date
|
||||
end
|
||||
|
||||
##
|
||||
# Checks if we are still in voting period
|
||||
# ====Returns
|
||||
# * +true+ -> If the voting period is not over yet
|
||||
# * +true+ -> If the voting period is not over yet (or if the voting dates are not set)
|
||||
# * +false+ -> If the voting period is over
|
||||
def voting_period?
|
||||
return false unless voting_start_date && voting_end_date
|
||||
return true unless voting_start_date && voting_end_date
|
||||
|
||||
(voting_start_date.to_datetime..voting_end_date.to_datetime).cover? Time.current
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue