internetee-registry/app/models/version/contact_version.rb
2023-03-16 11:28:25 +02:00

31 lines
642 B
Ruby

class Version::ContactVersion < PaperTrail::Version
include VersionSession
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.ransackable_attributes(auth_object = nil)
super
end
def self.ransackable_associations(auth_object = nil)
super
end
def self.csv_header
['Name', 'ID', 'Ident', 'Registrar', 'Action', 'Created at']
end
end