mirror of
https://github.com/internetee/registry.git
synced 2025-06-07 13:15:40 +02:00
Fix CC issue
This commit is contained in:
parent
c9d4aaded9
commit
15e090c3b1
1 changed files with 12 additions and 20 deletions
|
@ -8,26 +8,8 @@ module Serializers
|
||||||
@simplify = simplify
|
@simplify = simplify
|
||||||
end
|
end
|
||||||
|
|
||||||
def to_json
|
def to_json(_obj = nil)
|
||||||
if @simplify
|
return simple_object if @simplify
|
||||||
return {
|
|
||||||
id: domain.uuid,
|
|
||||||
name: domain.name,
|
|
||||||
registered_at: domain.registered_at,
|
|
||||||
valid_to: domain.valid_to,
|
|
||||||
outzone_at: domain.outzone_at,
|
|
||||||
registrant_verification_asked_at: domain.registrant_verification_asked_at,
|
|
||||||
statuses: domain.statuses,
|
|
||||||
registrar: {
|
|
||||||
name: domain.registrar.name,
|
|
||||||
website: domain.registrar.website,
|
|
||||||
},
|
|
||||||
registrant: {
|
|
||||||
name: domain.registrant.name,
|
|
||||||
id: domain.registrant.uuid,
|
|
||||||
},
|
|
||||||
}
|
|
||||||
end
|
|
||||||
|
|
||||||
{
|
{
|
||||||
id: domain.uuid,
|
id: domain.uuid,
|
||||||
|
@ -70,6 +52,16 @@ module Serializers
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|
||||||
|
def simple_object
|
||||||
|
{
|
||||||
|
id: domain.uuid, name: domain.name, registered_at: domain.registered_at,
|
||||||
|
valid_to: domain.valid_to, outzone_at: domain.outzone_at, statuses: domain.statuses,
|
||||||
|
registrant_verification_asked_at: domain.registrant_verification_asked_at,
|
||||||
|
registrar: { name: domain.registrar.name, website: domain.registrar.website },
|
||||||
|
registrant: { name: domain.registrant.name, id: domain.registrant.uuid }
|
||||||
|
}
|
||||||
|
end
|
||||||
|
|
||||||
def dnssec_keys
|
def dnssec_keys
|
||||||
domain.dnskeys.map do |key|
|
domain.dnskeys.map do |key|
|
||||||
"#{key.flags} #{key.protocol} #{key.alg} #{key.public_key}"
|
"#{key.flags} #{key.protocol} #{key.alg} #{key.public_key}"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue