From 887631f1ab74abab65e86ca5232fa05d9d2e1642 Mon Sep 17 00:00:00 2001 From: root Date: Sat, 5 Dec 2015 22:47:15 +0200 Subject: [PATCH 1/2] update_related_whois_records --- app/models/contact.rb | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/app/models/contact.rb b/app/models/contact.rb index fcebe8632..3fee7dd36 100644 --- a/app/models/contact.rb +++ b/app/models/contact.rb @@ -61,6 +61,8 @@ class Contact < ActiveRecord::Base manage_ok end + after_save :update_related_whois_records + # for overwrite when doing children loop attr_writer :domains_present @@ -468,4 +470,9 @@ class Contact < ActiveRecord::Base PENDING_DELETE ]).present? end + + def update_related_whois_records + related_domain_descriptions.each do |x, y| WhoisRecord.find_by(name: x).save + end + end From 5a23bac1a59e5429bc51a78a467276f7beed2a29 Mon Sep 17 00:00:00 2001 From: root Date: Sat, 5 Dec 2015 22:55:31 +0200 Subject: [PATCH 2/2] fix syntax error --- app/models/contact.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/contact.rb b/app/models/contact.rb index 3fee7dd36..54f289266 100644 --- a/app/models/contact.rb +++ b/app/models/contact.rb @@ -472,7 +472,7 @@ class Contact < ActiveRecord::Base end def update_related_whois_records - related_domain_descriptions.each do |x, y| WhoisRecord.find_by(name: x).save + related_domain_descriptions.each do |x, y| WhoisRecord.find_by(name: x).save end end end