mirror of
https://github.com/internetee/registry.git
synced 2025-06-10 14:44:47 +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
|
||||
|
||||
def domain_to_json(domain)
|
||||
# Smelly, but ActiveRecord objects are weird and do not respond
|
||||
# to usual syntax:
|
||||
# case a
|
||||
# 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
|
||||
status = case domain
|
||||
when ReservedDomain then RESERVED
|
||||
when BlockedDomain then BLOCKED
|
||||
end
|
||||
|
||||
punycode = SimpleIDN.to_ascii(domain.name)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue