From 97d816e1b11c9ca51fdd6d29b255aa7ad37ac0ef Mon Sep 17 00:00:00 2001 From: oleghasjanov Date: Fri, 18 Oct 2024 13:52:34 +0300 Subject: [PATCH] added list of blocked domains --- app/models/whois_record.rb | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/app/models/whois_record.rb b/app/models/whois_record.rb index 047aee84..65e2f084 100644 --- a/app/models/whois_record.rb +++ b/app/models/whois_record.rb @@ -37,6 +37,15 @@ 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 @@ -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