From f79f32fb5d81d9505061b9278954b360c978f6e2 Mon Sep 17 00:00:00 2001 From: oleghasjanov Date: Fri, 21 Mar 2025 12:09:47 +0200 Subject: [PATCH] added condition for underage --- app/models/epp/domain.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/epp/domain.rb b/app/models/epp/domain.rb index 6196c5e9f..70146430b 100644 --- a/app/models/epp/domain.rb +++ b/app/models/epp/domain.rb @@ -37,7 +37,7 @@ class Epp::Domain < Domain # validate registrant here as well ([Contact.find(registrant.id)] + active_admins + active_techs).each do |x| unless x.valid? - if x.type == 'AdminDomainContact' && x.underage? + if x.class.name == 'AdminDomainContact' && x.contact.underage? add_epp_error('2304', nil, nil, I18n.t('activerecord.errors.models.domain.contact_too_young')) else add_epp_error('2304', nil, nil, I18n.t(:contact_is_not_valid, value: x.try(:code)))