Sha256: 01d0c0e02b7aaf26a113e48c61db431cbb54e256665ebad0830723e668f00627

Contents?: true

Size: 721 Bytes

Versions: 19

Compression:

Stored size: 721 Bytes

Contents

# frozen_string_literal: true

module Decidim
  module Elections
    module Trustees
      # A class used to find trustees by participatory space trustee ids.
      class ByParticipatorySpaceTrusteeIds < Decidim::Query
        # Initializes the class.
        #
        def initialize(trustee_ids)
          @trustee_ids = trustee_ids
        end

        # Gets trustees by participatory space trustee ids.
        def query
          Decidim::Elections::Trustee
            .includes([:user])
            .joins(:trustees_participatory_spaces)
            .merge(Decidim::Elections::TrusteesParticipatorySpace.where(decidim_elections_trustee_id: @trustee_ids, considered: true))
        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/elections/trustees/by_participatory_space_trustee_ids.rb
decidim-elections-0.27.9 app/queries/decidim/elections/trustees/by_participatory_space_trustee_ids.rb
decidim-elections-0.28.3 app/queries/decidim/elections/trustees/by_participatory_space_trustee_ids.rb
decidim-elections-0.27.8 app/queries/decidim/elections/trustees/by_participatory_space_trustee_ids.rb
decidim-elections-0.28.2 app/queries/decidim/elections/trustees/by_participatory_space_trustee_ids.rb
decidim-elections-0.27.7 app/queries/decidim/elections/trustees/by_participatory_space_trustee_ids.rb
decidim-elections-0.28.1 app/queries/decidim/elections/trustees/by_participatory_space_trustee_ids.rb
decidim-elections-0.27.6 app/queries/decidim/elections/trustees/by_participatory_space_trustee_ids.rb
decidim-elections-0.28.0 app/queries/decidim/elections/trustees/by_participatory_space_trustee_ids.rb
decidim-elections-0.27.5 app/queries/decidim/elections/trustees/by_participatory_space_trustee_ids.rb
decidim-elections-0.28.0.rc5 app/queries/decidim/elections/trustees/by_participatory_space_trustee_ids.rb
decidim-elections-0.28.0.rc4 app/queries/decidim/elections/trustees/by_participatory_space_trustee_ids.rb
decidim-elections-0.27.4 app/queries/decidim/elections/trustees/by_participatory_space_trustee_ids.rb
decidim-elections-0.27.3 app/queries/decidim/elections/trustees/by_participatory_space_trustee_ids.rb
decidim-elections-0.27.2 app/queries/decidim/elections/trustees/by_participatory_space_trustee_ids.rb
decidim-elections-0.27.1 app/queries/decidim/elections/trustees/by_participatory_space_trustee_ids.rb
decidim-elections-0.27.0 app/queries/decidim/elections/trustees/by_participatory_space_trustee_ids.rb
decidim-elections-0.27.0.rc2 app/queries/decidim/elections/trustees/by_participatory_space_trustee_ids.rb
decidim-elections-0.27.0.rc1 app/queries/decidim/elections/trustees/by_participatory_space_trustee_ids.rb