Sha256: 6d1c4d9305c0831c538ec6542efb136fe3d0814c608881cce21244a68639ba7b

Contents?: true

Size: 837 Bytes

Versions: 19

Compression:

Stored size: 837 Bytes

Contents

# frozen_string_literal: true

module Decidim
  module Votings
    module Admin
      # A class used to find trustees by participatory space.
      class BallotStyleByVotingCode < Decidim::Query
        # Syntactic sugar to initialize the class and return the queried objects.
        #
        # voting - the voting of the Ballot Style
        # code - the code of the Ballot Style
        def self.for(voting, code)
          new(voting, code).query
        end

        # Initializes the class.
        def initialize(voting, code)
          @voting = voting
          @code = code
        end

        # Gets the ballot style with the specified code in this voting
        def query
          Decidim::Votings::BallotStyle
            .where(voting: @voting)
            .find_by(code: @code)
        end
      end
    end
  end
end

Version data entries

19 entries across 19 versions & 1 rubygems

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