Sha256: fc54b219c4466b8f634b70c6ded0012be5b5241818d38bd19909b032ed925c0b
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 < Rectify::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