mirror of
https://github.com/internetee/registry.git
synced 2025-08-04 17:01:44 +02:00
Refactor admin/contact_version
and admin/domain_version
csv generation logic
This commit is contained in:
parent
807419bc3a
commit
9fb4a6d7e6
19 changed files with 117 additions and 156 deletions
|
@ -4,4 +4,21 @@ class Version::ContactVersion < PaperTrail::Version
|
|||
|
||||
self.table_name = :log_contacts
|
||||
self.sequence_name = :log_contacts_id_seq
|
||||
|
||||
def as_csv_row
|
||||
contact = ObjectVersionsParser.new(self).parse
|
||||
|
||||
[
|
||||
contact.name,
|
||||
contact.code,
|
||||
contact.ident_human_description,
|
||||
contact.registrar,
|
||||
event,
|
||||
created_at.to_formatted_s(:db)
|
||||
]
|
||||
end
|
||||
|
||||
def self.csv_header
|
||||
['Name', 'ID', 'Ident', 'Registrar', 'Action', 'Created at'].freeze
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue