Sha256: aa3a6efa282292289014f25c2e3ef3ffa059ccbcdb03e39eb0467b412b9c4a39

Contents?: true

Size: 788 Bytes

Versions: 12

Compression:

Stored size: 788 Bytes

Contents

# frozen_string_literal: true

module Decidim
  module Sortitions
    module Admin
      # Query that retrieves a list of proposal components
      class ParticipatorySpaceProposalComponents < Decidim::Query
        attr_reader :participatory_space

        # Sugar syntax. Allow retrieving all proposal components for the
        # given participatory space.
        def self.for(participatory_space)
          new(participatory_space).query
        end

        # Initializes the query
        def initialize(participatory_space)
          @participatory_space = participatory_space
        end

        def query
          Component
            .where(participatory_space: participatory_space, manifest_name: "proposals")
            .published
        end
      end
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
decidim-sortitions-0.27.9 app/queries/decidim/sortitions/admin/participatory_space_proposal_components.rb
decidim-sortitions-0.27.8 app/queries/decidim/sortitions/admin/participatory_space_proposal_components.rb
decidim-sortitions-0.27.7 app/queries/decidim/sortitions/admin/participatory_space_proposal_components.rb
decidim-sortitions-0.27.6 app/queries/decidim/sortitions/admin/participatory_space_proposal_components.rb
decidim-sortitions-0.27.5 app/queries/decidim/sortitions/admin/participatory_space_proposal_components.rb
decidim-sortitions-0.27.4 app/queries/decidim/sortitions/admin/participatory_space_proposal_components.rb
decidim-sortitions-0.27.3 app/queries/decidim/sortitions/admin/participatory_space_proposal_components.rb
decidim-sortitions-0.27.2 app/queries/decidim/sortitions/admin/participatory_space_proposal_components.rb
decidim-sortitions-0.27.1 app/queries/decidim/sortitions/admin/participatory_space_proposal_components.rb
decidim-sortitions-0.27.0 app/queries/decidim/sortitions/admin/participatory_space_proposal_components.rb
decidim-sortitions-0.27.0.rc2 app/queries/decidim/sortitions/admin/participatory_space_proposal_components.rb
decidim-sortitions-0.27.0.rc1 app/queries/decidim/sortitions/admin/participatory_space_proposal_components.rb