1
0
Fork 0
This repository has been archived on 2023-03-27. You can view files and clone it, but cannot push or open issues or pull requests.
lpr-partynest/app/models/relationship.rb

23 lines
476 B
Ruby
Raw Normal View History

2019-04-27 10:24:04 -04:00
# frozen_string_literal: true
class Relationship < ApplicationRecord
################
# Associations #
################
belongs_to :person, inverse_of: :all_relationships
2019-07-20 06:52:03 -04:00
2019-08-17 23:55:12 -04:00
belongs_to :regional_office
2019-04-28 08:48:51 -04:00
belongs_to :initiator_account,
class_name: 'Account',
inverse_of: false,
optional: true
2019-04-28 08:48:51 -04:00
###############
# Validations #
###############
validates :from_date, presence: true, uniqueness: { scope: :person_id }
2019-04-27 10:24:04 -04:00
end