obdev/app/models/participant.rb

13 lines
330 B
Ruby

class Participant < ApplicationRecord
# This makes the association to Employer optional
belongs_to :employer, optional: true
belongs_to :worker, optional: true
validates :first_name, presence: true
validates :last_name, presence: true
# Other associations
has_and_belongs_to_many :programs
has_many :workers
end