Sha256: 6aae5bd2bf82ce39a1c85fb462d9d12dbb9a3797d893409342ea6bf2467537d2

Contents?: true

Size: 487 Bytes

Versions: 8

Compression:

Stored size: 487 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.1.0 app/queries/decidim/organization_participatory_processes.rb
decidim-core-0.0.8.1 app/queries/decidim/organization_participatory_processes.rb
decidim-core-0.0.7 app/queries/decidim/organization_participatory_processes.rb
decidim-core-0.0.6 app/queries/decidim/organization_participatory_processes.rb
decidim-core-0.0.5 app/queries/decidim/organization_participatory_processes.rb
decidim-core-0.0.3 app/queries/decidim/organization_participatory_processes.rb
decidim-core-0.0.2 app/queries/decidim/organization_participatory_processes.rb
decidim-core-0.0.1 app/queries/decidim/organization_participatory_processes.rb