Sha256: d0c22b91dc40657e64f7371991bdc0065c296aea40a92e3a849e81497e64acb9
Contents?: true
Size: 711 Bytes
Versions: 25
Compression:
Stored size: 711 Bytes
Contents
# frozen_string_literal: true module Decidim module Elections # A class used to find elections ready and near to start the voting period class ElectionsReadyToStart < Rectify::Query # Syntactic sugar to initialize the class and return the queried objects. def self.for new.query end # Finds the Elections that should be opened. def query Decidim::Elections::Election.bb_key_ceremony_ended .where("start_time <= ?", minimum_start_time) end private def minimum_start_time @minimum_start_time ||= Decidim::Elections.setup_minimum_hours_before_start.hours.from_now end end end end
Version data entries
25 entries across 25 versions & 1 rubygems