Sha256: e78de06bb055741c0a8382f6e4ce902538be058329fe37449e25fb8e068c0dad

Contents?: true

Size: 488 Bytes

Versions: 8

Compression:

Stored size: 488 Bytes

Contents

# frozen_string_literal: true

module Decidim
  # This query class returns the visible Participatory Processes given an
  # Organization.
  class OrganizationParticipatoryProcesses < Rectify::Query
    def initialize(organization)
      @organization = organization
    end

    def query
      raise MandatoryOrganization unless @organization
      ParticipatoryProcess.where(organization: @organization).published
    end

    class MandatoryOrganization < StandardError; end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
decidim-core-0.4.2 app/queries/decidim/organization_participatory_processes.rb
decidim-core-0.4.1 app/queries/decidim/organization_participatory_processes.rb
decidim-core-0.4.3 app/queries/decidim/organization_participatory_processes.rb
decidim-core-0.4.0 app/queries/decidim/organization_participatory_processes.rb
decidim-core-0.3.2 app/queries/decidim/organization_participatory_processes.rb
decidim-core-0.3.1 app/queries/decidim/organization_participatory_processes.rb
decidim-core-0.3.0 app/queries/decidim/organization_participatory_processes.rb
decidim-core-0.2.0 app/queries/decidim/organization_participatory_processes.rb