obdev/app/models/participant.rb

14 lines
321 B
Ruby

class Participant < ApplicationRecord
# Associations
belongs_to :employer, optional: true
has_many :employments
has_many :workers, through: :employments
# Validations
validates :first_name, presence: true
validates :last_name, presence: true
# Other associations
has_and_belongs_to_many :programs
end