Skip to content

Commit

Permalink
added list of blocked domains
Browse files Browse the repository at this point in the history
  • Loading branch information
OlegPhenomenon committed Oct 18, 2024
1 parent 8d5d735 commit 523cd6c
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion app/models/whois_record.rb
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,21 @@ def tech_contacts
json['tech_contacts'].map { |serialized_contact| deserialize_contact(serialized_contact) }
end

def status
if blocked_domains.include?(domain_name)
["Blocked"]
else
# Логика для получения статуса из базы данных или WHOIS
json['status'] || []
end
end

private

# rubocop:disable Metrics/AbcSize
def deserialize_domain
Domain.new(name: json['name'],
statuses: json['status'],
statuses: blocked_domains.include?(json['name']) ? ["Blocked"] : json['status'],
registered: json['registered'],
changed: json['changed'],
expire: json['expire'],
Expand Down Expand Up @@ -93,4 +102,8 @@ def partial_for_private_person(authorized)
'legal_person'
end
end

def blocked_domains
%w[com.ee fie.ee med.ee pri.ee]
end
end

0 comments on commit 523cd6c

Please sign in to comment.