mirror of
https://github.com/internetee/registry.git
synced 2025-06-12 07:34:45 +02:00
Properly match against class
Turns out I was wrong 😅
This commit is contained in:
parent
26858a7e8f
commit
960e4084e3
1 changed files with 3 additions and 10 deletions
|
@ -24,16 +24,9 @@ class RetainedDomains
|
||||||
end
|
end
|
||||||
|
|
||||||
def domain_to_json(domain)
|
def domain_to_json(domain)
|
||||||
# Smelly, but ActiveRecord objects are weird and do not respond
|
status = case domain
|
||||||
# to usual syntax:
|
when ReservedDomain then RESERVED
|
||||||
# case a
|
when BlockedDomain then BLOCKED
|
||||||
# when Array then "foo"
|
|
||||||
# when Hash then "bar"
|
|
||||||
# else "baz"
|
|
||||||
# end
|
|
||||||
status = case domain.class.to_s
|
|
||||||
when 'ReservedDomain' then RESERVED
|
|
||||||
when 'BlockedDomain' then BLOCKED
|
|
||||||
end
|
end
|
||||||
|
|
||||||
punycode = SimpleIDN.to_ascii(domain.name)
|
punycode = SimpleIDN.to_ascii(domain.name)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue