Sha256: 817b42750efa314fa8e42c0c9d31293e821fd300efce5b2ae3110b3edf610e1d

Contents?: true

Size: 788 Bytes

Versions: 63

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

63 entries across 63 versions & 1 rubygems

Version Path
decidim-sortitions-0.17.2 app/queries/decidim/sortitions/admin/participatory_space_proposal_components.rb
decidim-sortitions-0.18.0 app/queries/decidim/sortitions/admin/participatory_space_proposal_components.rb
decidim-sortitions-0.17.1 app/queries/decidim/sortitions/admin/participatory_space_proposal_components.rb
decidim-sortitions-0.16.1 app/queries/decidim/sortitions/admin/participatory_space_proposal_components.rb
decidim-sortitions-0.17.0 app/queries/decidim/sortitions/admin/participatory_space_proposal_components.rb
decidim-sortitions-0.16.0 app/queries/decidim/sortitions/admin/participatory_space_proposal_components.rb
decidim-sortitions-0.15.2 app/queries/decidim/sortitions/admin/participatory_space_proposal_components.rb
decidim-sortitions-0.15.1 app/queries/decidim/sortitions/admin/participatory_space_proposal_components.rb
decidim-sortitions-0.15.0 app/queries/decidim/sortitions/admin/participatory_space_proposal_components.rb
decidim-sortitions-0.14.4 app/queries/decidim/sortitions/admin/participatory_space_proposal_components.rb
decidim-sortitions-0.14.3 app/queries/decidim/sortitions/admin/participatory_space_proposal_components.rb
decidim-sortitions-0.14.2 app/queries/decidim/sortitions/admin/participatory_space_proposal_components.rb
decidim-sortitions-0.14.1 app/queries/decidim/sortitions/admin/participatory_space_proposal_components.rb
decidim-sortitions-0.13.1 app/queries/decidim/sortitions/admin/participatory_space_proposal_components.rb
decidim-sortitions-0.12.2 app/queries/decidim/sortitions/admin/participatory_space_proposal_components.rb
decidim-sortitions-0.13.0 app/queries/decidim/sortitions/admin/participatory_space_proposal_components.rb
decidim-sortitions-0.12.1 app/queries/decidim/sortitions/admin/participatory_space_proposal_components.rb
decidim-sortitions-0.13.0.pre1 app/queries/decidim/sortitions/admin/participatory_space_proposal_components.rb
decidim-sortitions-0.12.0 app/queries/decidim/sortitions/admin/participatory_space_proposal_components.rb
decidim-sortitions-0.11.2 app/queries/decidim/sortitions/admin/participatory_space_proposal_components.rb