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/passport.rb

39 lines
1.5 KiB
Ruby
Raw Normal View History

2018-11-29 20:19:38 -05:00
# frozen_string_literal: true
class Passport < ApplicationRecord
include RequiredNameable
2019-07-18 14:44:46 -04:00
2019-03-25 20:56:31 -04:00
################
# Associations #
################
belongs_to :person, optional: true
2019-07-22 09:52:23 -04:00
belongs_to :federal_subject, optional: true
2019-07-18 14:44:46 -04:00
###############
# Validations #
###############
2019-09-30 07:46:38 -04:00
validates :series, presence: true
validates :number, presence: true
validates :issued_by, presence: true
validates :unit_code, presence: true
2019-07-18 14:44:46 -04:00
validates :date_of_issue, presence: true
2019-07-22 09:52:23 -04:00
2019-09-30 07:46:38 -04:00
validates :zip_code, allow_nil: true, good_small_text: true
validates :town_type, allow_nil: true, good_small_text: true
validates :town_name, allow_nil: true, good_small_text: true
validates :settlement_type, allow_nil: true, good_small_text: true
validates :settlement_name, allow_nil: true, good_small_text: true
validates :district_type, allow_nil: true, good_small_text: true
validates :district_name, allow_nil: true, good_small_text: true
validates :street_type, allow_nil: true, good_small_text: true
validates :street_name, allow_nil: true, good_small_text: true
validates :residence_type, allow_nil: true, good_small_text: true
validates :residence_name, allow_nil: true, good_small_text: true
validates :building_type, allow_nil: true, good_small_text: true
validates :building_name, allow_nil: true, good_small_text: true
validates :apartment_type, allow_nil: true, good_small_text: true
validates :apartment_name, allow_nil: true, good_small_text: true
2018-11-29 20:19:38 -05:00
end