diff --git a/app/models/whois_record.rb b/app/models/whois_record.rb index 047aee84..e821d712 100644 --- a/app/models/whois_record.rb +++ b/app/models/whois_record.rb @@ -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'], @@ -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