clarion/app/models/participation.rb

9 lines
324 B
Ruby
Raw Permalink Normal View History

class Participation < ActiveRecord::Base
2019-04-28 21:10:54 +03:00
belongs_to :participant, class_name: "User"
has_one :participant_with_personal_profile, class_name: "Participant"
belongs_to :event
validates :participant_id, presence: true
2019-04-28 21:10:54 +03:00
scope :approved, -> { where approved: true }
scope :pending, -> { where.not approved: true }
end