rohitverma007/consuldemocracy

Show future events in admin booths view

Closed this issue · 1 comments

In app/models/poll.rb, add a method to the Poll model call future_event?, that takes in timestamp as a parameter, with default value being Time.current. The method checks if the Poll is a future event by checking whether the starts_at property of the Poll starts in the future by comparing it with the timestamp.
Also, add a new method in app/models/poll/booth.rb, called self.available_for_admin that is a slightly modified version of “available” method, it should return current_or_recounting and future_event? polls

https://github.com/rohitverma007/consuldemocracy/blob/master/app/models/poll.rb

https://github.com/consuldemocracy/consuldemocracy/blob/master/app/models/poll/booth.rb

closed by #2