Sha256: 0c5c45a341a90efeec1d48c0cbf568f992ad222a64481185bc2ca8056bd78422

Contents?: true

Size: 474 Bytes

Versions: 8

Compression:

Stored size: 474 Bytes

Contents

# frozen_string_literal: true

module Decidim
  module ActionDelegator
    class GranteeDelegations
      def self.for(consultation, user)
        new(consultation, user).query
      end

      def initialize(consultation, user)
        @consultation = consultation
        @user = user
      end

      def query
        ConsultationDelegations.for(consultation).where(grantee_id: user.id)
      end

      private

      attr_reader :consultation, :user
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

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