mirror of
https://github.com/internetee/registry.git
synced 2025-07-20 09:46:09 +02:00
Refactor #2825
This commit is contained in:
parent
fca74e2ede
commit
a2b6409460
1 changed files with 2 additions and 7 deletions
|
@ -12,13 +12,8 @@ class Epp::Domain < Domain
|
||||||
after_validation :validate_contacts
|
after_validation :validate_contacts
|
||||||
def validate_contacts
|
def validate_contacts
|
||||||
ok = true
|
ok = true
|
||||||
if new_record?
|
ac = admin_domain_contacts.includes(:contact).select { |x| !x.marked_for_destruction? }.map(&:contact)
|
||||||
ac = admin_domain_contacts.map(&:contact)
|
tc = tech_domain_contacts.includes(:contact).select { |x| !x.marked_for_destruction? }.map(&:contact)
|
||||||
tc = tech_domain_contacts.map(&:contact)
|
|
||||||
else
|
|
||||||
ac = contacts
|
|
||||||
tc = []
|
|
||||||
end
|
|
||||||
# validate registrant here as well
|
# validate registrant here as well
|
||||||
([registrant] + ac + tc).each do |x|
|
([registrant] + ac + tc).each do |x|
|
||||||
unless x.valid?
|
unless x.valid?
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue