Sha256: 8682dd266fda1e6471a1be2f927b8651e74e160229612d9225a002732bc89f33

Contents?: true

Size: 572 Bytes

Versions: 7

Compression:

Stored size: 572 Bytes

Contents

# frozen_string_literal: true

module Decidim
  module ActionDelegator
    class OrganizationDelegations < Rectify::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

7 entries across 7 versions & 1 rubygems

Version Path
decidim-action_delegator-0.7.2 app/queries/decidim/action_delegator/organization_delegations.rb
decidim-action_delegator-0.7.1 app/queries/decidim/action_delegator/organization_delegations.rb
decidim-action_delegator-0.7.0 app/queries/decidim/action_delegator/organization_delegations.rb
decidim-action_delegator-0.6.0 app/queries/decidim/action_delegator/organization_delegations.rb
decidim-action_delegator-0.5.0 app/queries/decidim/action_delegator/organization_delegations.rb
decidim-action_delegator-0.4.1 app/queries/decidim/action_delegator/organization_delegations.rb
decidim-action_delegator-0.4 app/queries/decidim/action_delegator/organization_delegations.rb