Sha256: 1c1a1cc07b69336acc447c924005af5dc9d0981614ecaa545f6feb0dc36573c6

Contents?: true

Size: 498 Bytes

Versions: 1

Compression:

Stored size: 498 Bytes

Contents

# frozen_string_literal: true

module Decidim
  module ActionDelegator
    class ConsultationDelegations < Decidim::Query
      def self.for(consultation)
        new(consultation).query
      end

      def initialize(consultation)
        @consultation = consultation
      end

      def query
        Delegation
          .joins(setting: :consultation)
          .where(decidim_consultations: { id: consultation.id })
      end

      private

      attr_reader :consultation
    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/consultation_delegations.rb