Class: Decidim::Conferences::Admin::ConferenceInvites

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

Overview

A class used to find the ConferenceInvites by their status status.

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Query

#cached_query, #each, #eager?, #exists?, merge, #none?, #relation?, #|

Constructor Details

#initialize(conference_invites, query = nil, status = nil) ⇒ ConferenceInvites

Initializes the class.

conference_invites - the initial Invites relation that need to be filtered query - query to filter conference_invites status - invite status to be used as a filter


22
23
24
25
26
# File 'decidim-conferences/app/queries/decidim/conferences/admin/conference_invites.rb', line 22

def initialize(conference_invites, query = nil, status = nil)
  @conference_invites = conference_invites
  @query = query
  @status = status
end

Class Method Details

.for(conference_invites, query = nil, status = nil) ⇒ Object

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

conference_invites - the initial Invites relation that needs to be filtered. query - query to filter conference_invites status - invite status to be used as a filter


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

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

Instance Method Details

#queryObject

List the conference_invites by the different filters.


29
30
31
32
33
# File 'decidim-conferences/app/queries/decidim/conferences/admin/conference_invites.rb', line 29

def query
  @conference_invites = filter_by_search(@conference_invites)
  @conference_invites = filter_by_status(@conference_invites)
  @conference_invites
end