Added csv export to registrar api_users and white_ips

This commit is contained in:
Sergei Tsoganov 2023-05-15 14:11:46 +03:00
parent 316f00cadc
commit 0f16ec77f5
11 changed files with 104 additions and 6 deletions

View file

@ -72,5 +72,19 @@ class WhiteIp < ApplicationRecord
rescue StandardError => _e
nil
end
def csv_header
%w[IPv4 IPv6 Interfaces Created Updated]
end
end
def as_csv_row
[
ipv4,
ipv6,
interfaces.join(', ').upcase,
created_at,
updated_at
]
end
end