internetee-registry/app/models/legacy/contact.rb
2015-12-16 11:48:59 +02:00

16 lines
409 B
Ruby

module Legacy
class Contact < Db
IDENT_TYPE_MAP = {
2 => ::Contact::PRIV,
3 => ::Contact::PASSPORT,
4 => ::Contact::ORG,
6 => ::Contact::BIRTHDAY
}
self.table_name = :contact
belongs_to :object_registry, foreign_key: :id
belongs_to :object, foreign_key: :id
has_one :object_state, -> { where('valid_to IS NULL') }, foreign_key: :object_id
end
end