osem-fcy/app/models/events_registration.rb

13 lines
320 B
Ruby
Raw Normal View History

class EventsRegistration < ActiveRecord::Base
belongs_to :registration
belongs_to :event
2016-04-22 18:18:46 +03:00
has_one :user, through: :registration
delegate :name, to: :registration
delegate :email, to: :registration
validates :event, :registration, presence: true
validates :event, uniqueness: { scope: :registration }
end