Sha256: 89aaa1d49947d7e6bdd562e4e352623cbbfe9c4d6c6e2e5ba958267ca358b094

Contents?: true

Size: 712 Bytes

Versions: 2

Compression:

Stored size: 712 Bytes

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::DataPortability

      belongs_to :conference, foreign_key: "decidim_conference_id", class_name: "Decidim::Conference"
      belongs_to :user, foreign_key: "decidim_user_id", class_name: "Decidim::User"

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

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

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

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
decidim-conferences-0.15.2 app/models/decidim/conferences/conference_registration.rb
decidim-conferences-0.15.1 app/models/decidim/conferences/conference_registration.rb