Sha256: 40a8ef125877b3556c43062771f244c379c03ada6662ebfaf073eeee07adbdaf

Contents?: true

Size: 1.08 KB

Versions: 25

Compression:

Stored size: 1.08 KB

Contents

# frozen_string_literal: true

module Decidim
  module Conferences
    # The data store for a Registration in the Decidim::Conferences component.
    class ConferenceRegistration < ApplicationRecord
      include Decidim::DownloadYourData

      belongs_to :conference, foreign_key: "decidim_conference_id", class_name: "Decidim::Conference"
      belongs_to :user, foreign_key: "decidim_user_id", class_name: "Decidim::User"
      belongs_to :registration_type, foreign_key: "decidim_conference_registration_type_id", class_name: "Decidim::Conferences::RegistrationType"

      validates :user, uniqueness: { scope: :conference }

      scope :confirmed, -> { where.not(confirmed_at: nil) }

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

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

      def confirmed?
        confirmed_at.present?
      end

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

Version data entries

25 entries across 25 versions & 1 rubygems

Version Path
decidim-conferences-0.27.2 app/models/decidim/conferences/conference_registration.rb
decidim-conferences-0.27.1 app/models/decidim/conferences/conference_registration.rb
decidim-conferences-0.27.0 app/models/decidim/conferences/conference_registration.rb
decidim-conferences-0.27.0.rc2 app/models/decidim/conferences/conference_registration.rb
decidim-conferences-0.27.0.rc1 app/models/decidim/conferences/conference_registration.rb