Class: Decidim::Assemblies::AssemblySearch

Inherits:
ParticipatorySpaceSearch show all
Defined in:
decidim-assemblies/app/services/decidim/assemblies/assembly_search.rb

Overview

Service that encapsulates all logic related to filtering assemblies.

Instance Method Summary collapse

Methods inherited from ParticipatorySpaceSearch

#base_query, #search_area_id, #search_scope_id

Constructor Details

#initialize(options = {}) ⇒ AssemblySearch

Returns a new instance of AssemblySearch.


7
8
9
# File 'decidim-assemblies/app/services/decidim/assemblies/assembly_search.rb', line 7

def initialize(options = {})
  super(Assembly.all, options)
end

Instance Method Details

#search_type_idObject


11
12
13
14
15
# File 'decidim-assemblies/app/services/decidim/assemblies/assembly_search.rb', line 11

def search_type_id
  return query if type_id.blank?

  query.where(decidim_assemblies_type_id: type_id)
end