Sha256: f3e1dfdb8d90466e3daa556bd6d06b905cfc897a6b951fbb8fae7f8e38251c56

Contents?: true

Size: 532 Bytes

Versions: 19

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 < Decidim::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

19 entries across 19 versions & 1 rubygems

Version Path
decidim-elections-0.28.4 app/queries/decidim/elections/elections_finished_to_end.rb
decidim-elections-0.27.9 app/queries/decidim/elections/elections_finished_to_end.rb
decidim-elections-0.28.3 app/queries/decidim/elections/elections_finished_to_end.rb
decidim-elections-0.27.8 app/queries/decidim/elections/elections_finished_to_end.rb
decidim-elections-0.28.2 app/queries/decidim/elections/elections_finished_to_end.rb
decidim-elections-0.27.7 app/queries/decidim/elections/elections_finished_to_end.rb
decidim-elections-0.28.1 app/queries/decidim/elections/elections_finished_to_end.rb
decidim-elections-0.27.6 app/queries/decidim/elections/elections_finished_to_end.rb
decidim-elections-0.28.0 app/queries/decidim/elections/elections_finished_to_end.rb
decidim-elections-0.27.5 app/queries/decidim/elections/elections_finished_to_end.rb
decidim-elections-0.28.0.rc5 app/queries/decidim/elections/elections_finished_to_end.rb
decidim-elections-0.28.0.rc4 app/queries/decidim/elections/elections_finished_to_end.rb
decidim-elections-0.27.4 app/queries/decidim/elections/elections_finished_to_end.rb
decidim-elections-0.27.3 app/queries/decidim/elections/elections_finished_to_end.rb
decidim-elections-0.27.2 app/queries/decidim/elections/elections_finished_to_end.rb
decidim-elections-0.27.1 app/queries/decidim/elections/elections_finished_to_end.rb
decidim-elections-0.27.0 app/queries/decidim/elections/elections_finished_to_end.rb
decidim-elections-0.27.0.rc2 app/queries/decidim/elections/elections_finished_to_end.rb
decidim-elections-0.27.0.rc1 app/queries/decidim/elections/elections_finished_to_end.rb