Sha256: 19d9622afcdb022042645696561984d2eb49bbcebfcf0ebac0b5663d4692ee52

Contents?: true

Size: 710 Bytes

Versions: 41

Compression:

Stored size: 710 Bytes

Contents

# frozen_string_literal: true

module Decidim
  module ParticipatoryProcesses
    # A class used to find the ParticipatoryProcesses from a ProcessGroup.
    class ParticipatoryProcessesByGroup < Rectify::Query
      # Syntactic sugar to initialize the class and return the queried objects.
      def self.for(process_group)
        new(process_group).query
      end

      # Initializes the class.
      def initialize(process_group)
        @process_group = process_group
      end

      def processes
        ParticipatoryProcess
      end

      def query
        return processes.all unless @process_group

        processes.where(participatory_process_group: @process_group)
      end
    end
  end
end

Version data entries

41 entries across 41 versions & 1 rubygems

Version Path
decidim-participatory_processes-0.26.10 app/queries/decidim/participatory_processes/participatory_processes_by_group.rb
decidim-participatory_processes-0.26.9 app/queries/decidim/participatory_processes/participatory_processes_by_group.rb
decidim-participatory_processes-0.26.8 app/queries/decidim/participatory_processes/participatory_processes_by_group.rb
decidim-participatory_processes-0.26.7 app/queries/decidim/participatory_processes/participatory_processes_by_group.rb
decidim-participatory_processes-0.26.5 app/queries/decidim/participatory_processes/participatory_processes_by_group.rb
decidim-participatory_processes-0.26.4 app/queries/decidim/participatory_processes/participatory_processes_by_group.rb
decidim-participatory_processes-0.26.3 app/queries/decidim/participatory_processes/participatory_processes_by_group.rb
decidim-participatory_processes-0.26.2 app/queries/decidim/participatory_processes/participatory_processes_by_group.rb
decidim-participatory_processes-0.26.1 app/queries/decidim/participatory_processes/participatory_processes_by_group.rb
decidim-participatory_processes-0.26.0 app/queries/decidim/participatory_processes/participatory_processes_by_group.rb
decidim-participatory_processes-0.26.0.rc2 app/queries/decidim/participatory_processes/participatory_processes_by_group.rb
decidim-participatory_processes-0.26.0.rc1 app/queries/decidim/participatory_processes/participatory_processes_by_group.rb
decidim-participatory_processes-0.25.2 app/queries/decidim/participatory_processes/participatory_processes_by_group.rb
decidim-participatory_processes-0.25.1 app/queries/decidim/participatory_processes/participatory_processes_by_group.rb
decidim-participatory_processes-0.25.0 app/queries/decidim/participatory_processes/participatory_processes_by_group.rb
decidim-participatory_processes-0.25.0.rc4 app/queries/decidim/participatory_processes/participatory_processes_by_group.rb
decidim-participatory_processes-0.25.0.rc3 app/queries/decidim/participatory_processes/participatory_processes_by_group.rb
decidim-participatory_processes-0.25.0.rc2 app/queries/decidim/participatory_processes/participatory_processes_by_group.rb
decidim-participatory_processes-0.25.0.rc1 app/queries/decidim/participatory_processes/participatory_processes_by_group.rb
decidim-participatory_processes-0.24.3 app/queries/decidim/participatory_processes/participatory_processes_by_group.rb