mirror of
https://github.com/openSUSE/osem.git
synced 2026-08-13 19:54:02 +00:00
22 lines
478 B
Ruby
22 lines
478 B
Ruby
# frozen_string_literal: true
|
|
|
|
class EventsRegistration < ApplicationRecord
|
|
belongs_to :registration
|
|
belongs_to :event
|
|
|
|
has_one :user, through: :registration
|
|
|
|
has_paper_trail meta: { conference_id: :conference_id }
|
|
|
|
delegate :name, to: :registration
|
|
delegate :email, to: :registration
|
|
|
|
validates :event, :registration, presence: true
|
|
validates :event, uniqueness: { scope: :registration }
|
|
|
|
private
|
|
|
|
def conference_id
|
|
registration.conference_id
|
|
end
|
|
end
|