Sha256: fc7c8ba0bd4f4f985f6e3001a393cf44a86dd605bed7193c319d82db6fb8c864
Contents?: true
Size: 1.03 KB
Versions: 27
Compression:
Stored size: 1.03 KB
Contents
# frozen_string_literal: true module Decidim module Meetings # The data store for an Invite in the Decidim::Meetings component. class Invite < Meetings::ApplicationRecord include Decidim::Traceable include Decidim::Loggable include Decidim::DownloadYourData belongs_to :meeting, foreign_key: "decidim_meeting_id", class_name: "Decidim::Meetings::Meeting" belongs_to :user, foreign_key: "decidim_user_id", class_name: "Decidim::User" validates :user, uniqueness: { scope: :meeting } def self.export_serializer Decidim::Meetings::DownloadYourDataInviteSerializer end def self.log_presenter_class_for(_log) Decidim::Meetings::AdminLog::InvitePresenter end def self.user_collection(user) where(decidim_user_id: user.id) end def accept! update!(accepted_at: Time.current, rejected_at: nil) end def reject! update!(rejected_at: Time.current, accepted_at: nil) end alias decline! reject! end end end
Version data entries
27 entries across 27 versions & 1 rubygems