Class: Decidim::Conferences::ConferenceInvite
- Inherits:
-
ApplicationRecord
- Object
- ApplicationRecord
- Decidim::Conferences::ConferenceInvite
- Includes:
- DownloadYourData, Loggable, Traceable
- Defined in:
- app/models/decidim/conferences/conference_invite.rb
Overview
The data store for an Invite in the Decidim::Conferences component.
Class Method Summary collapse
- .export_serializer ⇒ Object
- .log_presenter_class_for(_log) ⇒ Object
- .ransackable_associations(_auth_object = nil) ⇒ Object
- .ransackable_attributes(auth_object = nil) ⇒ Object
- .user_collection(user) ⇒ Object
Instance Method Summary collapse
- #accept! ⇒ Object
- #reject! ⇒ Object (also: #decline!)
Class Method Details
.export_serializer ⇒ Object
17 18 19 |
# File 'app/models/decidim/conferences/conference_invite.rb', line 17 def self.export_serializer Decidim::Conferences::DownloadYourDataConferenceInviteSerializer end |
.log_presenter_class_for(_log) ⇒ Object
21 22 23 |
# File 'app/models/decidim/conferences/conference_invite.rb', line 21 def self.log_presenter_class_for(_log) Decidim::Conferences::AdminLog::InvitePresenter end |
.ransackable_associations(_auth_object = nil) ⇒ Object
31 32 33 |
# File 'app/models/decidim/conferences/conference_invite.rb', line 31 def self.ransackable_associations(_auth_object = nil) %w(user) end |
.ransackable_attributes(auth_object = nil) ⇒ Object
25 26 27 28 29 |
# File 'app/models/decidim/conferences/conference_invite.rb', line 25 def self.ransackable_attributes(auth_object = nil) return [] unless auth_object&.admin? %w(accepted_at rejected_at sent_at) end |
.user_collection(user) ⇒ Object
35 36 37 |
# File 'app/models/decidim/conferences/conference_invite.rb', line 35 def self.user_collection(user) where(decidim_user_id: user.id) end |
Instance Method Details
#accept! ⇒ Object
39 40 41 |
# File 'app/models/decidim/conferences/conference_invite.rb', line 39 def accept! update!(accepted_at: Time.current, rejected_at: nil) end |
#reject! ⇒ Object Also known as: decline!
43 44 45 |
# File 'app/models/decidim/conferences/conference_invite.rb', line 43 def reject! update!(rejected_at: Time.current, accepted_at: nil) end |