Sha256: 04dfb16599a76ffe22151e49ea4854410653b43357ea73445d9af876eb247b23

Contents?: true

Size: 802 Bytes

Versions: 19

Compression:

Stored size: 802 Bytes

Contents

# frozen_string_literal: true

module Decidim
  module Votings
    module Votes
      # A class used to find a non-rejected in person vote registered for a voter in an election
      class InPersonVoteForVoter < Rectify::Query
        # Syntactic sugar to initialize the class and return the queried objects.
        #
        # election - the election where the vote was casted
        # voter_id - the identifier of the voter
        def self.for(election, voter_id)
          new(election, voter_id).query
        end

        def initialize(election, voter_id)
          @voter_id = voter_id
          @election = election
        end

        def query
          Decidim::Votings::InPersonVote.not_rejected.find_by(election: @election, voter_id: @voter_id)
        end
      end
    end
  end
end

Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
decidim-elections-0.26.10 app/queries/decidim/votings/votes/in_person_vote_for_voter.rb
decidim-elections-0.26.9 app/queries/decidim/votings/votes/in_person_vote_for_voter.rb
decidim-elections-0.26.8 app/queries/decidim/votings/votes/in_person_vote_for_voter.rb
decidim-elections-0.26.7 app/queries/decidim/votings/votes/in_person_vote_for_voter.rb
decidim-elections-0.26.5 app/queries/decidim/votings/votes/in_person_vote_for_voter.rb
decidim-elections-0.26.4 app/queries/decidim/votings/votes/in_person_vote_for_voter.rb
decidim-elections-0.26.3 app/queries/decidim/votings/votes/in_person_vote_for_voter.rb
decidim-elections-0.26.2 app/queries/decidim/votings/votes/in_person_vote_for_voter.rb
decidim-elections-0.26.1 app/queries/decidim/votings/votes/in_person_vote_for_voter.rb
decidim-elections-0.26.0 app/queries/decidim/votings/votes/in_person_vote_for_voter.rb
decidim-elections-0.26.0.rc2 app/queries/decidim/votings/votes/in_person_vote_for_voter.rb
decidim-elections-0.26.0.rc1 app/queries/decidim/votings/votes/in_person_vote_for_voter.rb
decidim-elections-0.25.2 app/queries/decidim/votings/votes/in_person_vote_for_voter.rb
decidim-elections-0.25.1 app/queries/decidim/votings/votes/in_person_vote_for_voter.rb
decidim-elections-0.25.0 app/queries/decidim/votings/votes/in_person_vote_for_voter.rb
decidim-elections-0.25.0.rc4 app/queries/decidim/votings/votes/in_person_vote_for_voter.rb
decidim-elections-0.25.0.rc3 app/queries/decidim/votings/votes/in_person_vote_for_voter.rb
decidim-elections-0.25.0.rc2 app/queries/decidim/votings/votes/in_person_vote_for_voter.rb
decidim-elections-0.25.0.rc1 app/queries/decidim/votings/votes/in_person_vote_for_voter.rb