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
|
||||
def validate_contacts
|
||||
ok = true
|
||||
if new_record?
|
||||
ac = admin_domain_contacts.map(&:contact)
|
||||
tc = tech_domain_contacts.map(&:contact)
|
||||
else
|
||||
ac = contacts
|
||||
tc = []
|
||||
end
|
||||
ac = admin_domain_contacts.includes(:contact).select { |x| !x.marked_for_destruction? }.map(&:contact)
|
||||
tc = tech_domain_contacts.includes(:contact).select { |x| !x.marked_for_destruction? }.map(&:contact)
|
||||
# validate registrant here as well
|
||||
([registrant] + ac + tc).each do |x|
|
||||
unless x.valid?
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue