Class: Decidim::Conferences::Admin::ConferenceSpeakers

Inherits:
Rectify::Query
  • Object
show all
Defined in:
decidim-conferences/app/queries/decidim/conferences/admin/conference_speakers.rb

Overview

A class used to find the ConferenceSpeakers's by the search.

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(conference_speakers, query = nil) ⇒ ConferenceSpeakers

Initializes the class.

conference_speakers - the ConferenceSpeaker relation that need to be filtered query - query to filter user group names


20
21
22
23
# File 'decidim-conferences/app/queries/decidim/conferences/admin/conference_speakers.rb', line 20

def initialize(conference_speakers, query = nil)
  @conference_speakers = conference_speakers
  @query = query
end

Class Method Details

.for(conference_speakers, query = nil) ⇒ Object

Syntactic sugar to initialize the class and return the queried objects.

conference_speakers - the initial ConferenceSpeaker relation that needs to be filtered. query - query to filter user group names


12
13
14
# File 'decidim-conferences/app/queries/decidim/conferences/admin/conference_speakers.rb', line 12

def self.for(conference_speakers, query = nil)
  new(conference_speakers, query).query
end

Instance Method Details

#queryObject

List the conference speakers by the different filters.


26
27
28
29
# File 'decidim-conferences/app/queries/decidim/conferences/admin/conference_speakers.rb', line 26

def query
  @conference_speakers = filter_by_search(@conference_speakers)
  @conference_speakers
end