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