2024-01-16 20:54:44 -06:00
|
|
|
class Employer < ApplicationRecord
|
2024-02-05 15:58:46 -06:00
|
|
|
# Direct association with participants
|
|
|
|
has_many :direct_participants, class_name: 'Participant'
|
2024-02-02 23:12:36 -06:00
|
|
|
|
2024-02-05 15:58:46 -06:00
|
|
|
# Association through EmployerRecord
|
|
|
|
has_many :employer_records
|
|
|
|
has_many :indirect_participants, through: :employer_records, source: :participant
|
2024-01-29 22:04:56 -06:00
|
|
|
|
2024-02-05 15:58:46 -06:00
|
|
|
# Association with Workers through direct_participants
|
|
|
|
has_many :workers, through: :direct_participants
|
|
|
|
|
|
|
|
# Other methods...
|
2024-02-05 16:18:06 -06:00
|
|
|
def full_name
|
|
|
|
"#{first_name} #{last_name}"
|
|
|
|
end
|
2024-02-05 15:58:46 -06:00
|
|
|
end
|