mirror of
https://github.com/internetee/registry.git
synced 2025-08-01 23:42:04 +02:00
Logging contacts and addresses,view undeleted ones
This commit is contained in:
parent
bb3d2cc88a
commit
d94eb22fc6
14 changed files with 263 additions and 3 deletions
|
@ -10,8 +10,7 @@ class Address < ActiveRecord::Base
|
|||
belongs_to :contact
|
||||
belongs_to :country
|
||||
|
||||
# TODO: validate inclusion of :type in LONG_TYPES or smth similar
|
||||
# validates_inclusion_of :type, in: TYPES
|
||||
has_paper_trail class_name: 'AddressVersion'
|
||||
|
||||
class << self
|
||||
# def validate_postal_info_types(parsed_frame)
|
||||
|
|
4
app/models/address_version.rb
Normal file
4
app/models/address_version.rb
Normal file
|
@ -0,0 +1,4 @@
|
|||
class AddressVersion < PaperTrail::Version
|
||||
self.table_name = :address_versions
|
||||
self.sequence_name = :address_version_id_seq
|
||||
end
|
|
@ -1,6 +1,7 @@
|
|||
class Contact < ActiveRecord::Base
|
||||
# TODO: Foreign contact will get email with activation link/username/temp password
|
||||
# TODO: Phone number validation, in first phase very minimam in order to support current registries
|
||||
# TODO: Validate presence of name
|
||||
|
||||
include EppErrors
|
||||
|
||||
|
@ -32,6 +33,9 @@ class Contact < ActiveRecord::Base
|
|||
delegate :street, to: :address#, prefix: true
|
||||
delegate :zip, to: :address#, prefix: true
|
||||
|
||||
# archiving
|
||||
has_paper_trail class_name: 'AddressVersion'
|
||||
|
||||
IDENT_TYPE_ICO = 'ico'
|
||||
IDENT_TYPES = [
|
||||
IDENT_TYPE_ICO, # Company registry code (or similar)
|
||||
|
|
4
app/models/contact_version.rb
Normal file
4
app/models/contact_version.rb
Normal file
|
@ -0,0 +1,4 @@
|
|||
class ContactVersion < PaperTrail::Version
|
||||
self.table_name = :contact_versions
|
||||
self.sequence_name = :contact_version_id_seq
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue