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

25 lines
497 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
2019-04-28 08:48:51 -04:00
belongs_to :regional_office
###############
# Validations #
###############
2019-04-28 09:24:01 -04:00
validates :number,
2019-04-28 09:34:46 -04:00
presence: true,
uniqueness: { scope: :person_id },
2019-04-28 09:24:01 -04:00
numericality: {
2019-04-28 09:34:46 -04:00
only_integer: true,
2019-04-28 09:24:01 -04:00
greater_than_or_equal_to: 0,
}
validates :active_since, presence: true
2019-04-27 10:24:04 -04:00
end