2024-01-16 20:54:44 -06:00
|
|
|
class Vendor < ApplicationRecord
|
|
|
|
# Many-to-many relationships
|
|
|
|
has_and_belongs_to_many :employers
|
2024-01-31 02:19:24 -06:00
|
|
|
has_many :service_contracts
|
|
|
|
has_many :participants, through: :service_contracts
|
2024-02-06 17:36:08 -06:00
|
|
|
|
|
|
|
# Validations
|
|
|
|
validates :tin, uniqueness: true, allow_blank: true, presence: true
|
2024-01-16 20:54:44 -06:00
|
|
|
end
|