Sha256: 0c4f608c33c8b47d25d04ddc94f5fdfd4999cd192496edf52bde4a12e2b301e7

Contents?: true

Size: 572 Bytes

Versions: 1

Compression:

Stored size: 572 Bytes

Contents

# frozen_string_literal: true

module Decidim
  module ActionDelegator
    class OrganizationDelegations < Decidim::Query
      def initialize(organization)
        @organization = organization
      end

      def query
        Delegation
          .joins(setting: :consultation)
          .merge(organization_consultations)
          .includes(:grantee, :granter)
      end

      private

      attr_reader :organization

      def organization_consultations
        Decidim::Consultations::OrganizationConsultations.new(organization).query
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
decidim-action_delegator-0.8.1 app/queries/decidim/action_delegator/organization_delegations.rb