Class: Decidim::Conferences::ConferenceInvite

Inherits:
ApplicationRecord show all
Includes:
DataPortability, Loggable, Traceable
Defined in:
decidim-conferences/app/models/decidim/conferences/conference_invite.rb

Overview

The data store for an Invite in the Decidim::Conferences component.

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.export_serializerObject


17
18
19
# File 'decidim-conferences/app/models/decidim/conferences/conference_invite.rb', line 17

def self.export_serializer
  Decidim::Conferences::DataPortabilityConferenceInviteSerializer
end

.log_presenter_class_for(_log) ⇒ Object


21
22
23
# File 'decidim-conferences/app/models/decidim/conferences/conference_invite.rb', line 21

def self.log_presenter_class_for(_log)
  Decidim::Conferences::AdminLog::InvitePresenter
end

.user_collection(user) ⇒ Object


25
26
27
# File 'decidim-conferences/app/models/decidim/conferences/conference_invite.rb', line 25

def self.user_collection(user)
  where(decidim_user_id: user.id)
end

Instance Method Details

#accept!Object


29
30
31
# File 'decidim-conferences/app/models/decidim/conferences/conference_invite.rb', line 29

def accept!
  update!(accepted_at: Time.current, rejected_at: nil)
end

#reject!Object Also known as: decline!


33
34
35
# File 'decidim-conferences/app/models/decidim/conferences/conference_invite.rb', line 33

def reject!
  update!(rejected_at: Time.current, accepted_at: nil)
end