Sha256: 3da5e75a287c9943f33c196e28b73fa4b74b65593f160055e74a985c2433fd31

Contents?: true

Size: 721 Bytes

Versions: 25

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

25 entries across 25 versions & 1 rubygems

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