Sha256: e6f290f816d9b9655421615c5a5579edc42a558c14689caf3ee6e3421c789c4b

Contents?: true

Size: 532 Bytes

Versions: 25

Compression:

Stored size: 532 Bytes

Contents

# frozen_string_literal: true

module Decidim
  module Elections
    # A class used to find elections finished to close their voting period
    class ElectionsFinishedToEnd < 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 closed.
      def query
        Decidim::Elections::Election.bb_vote
                                    .where("end_time <= ?", Time.current)
      end
    end
  end
end

Version data entries

25 entries across 25 versions & 1 rubygems

Version Path
decidim-elections-0.24.2 app/queries/decidim/elections/elections_finished_to_end.rb
decidim-elections-0.24.1 app/queries/decidim/elections/elections_finished_to_end.rb
decidim-elections-0.24.0 app/queries/decidim/elections/elections_finished_to_end.rb
decidim-elections-0.24.0.rc2 app/queries/decidim/elections/elections_finished_to_end.rb
decidim-elections-0.24.0.rc1 app/queries/decidim/elections/elections_finished_to_end.rb