From 0d6f06123bee8ee2ea4ac03e132be52640ed6e27 Mon Sep 17 00:00:00 2001 From: Georg Kahest Date: Tue, 8 Dec 2015 13:46:29 +0200 Subject: [PATCH 1/2] cleaner syntax --- 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 54f289266..dace4d968 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 end + related_domain_descriptions.each{ |x, y| WhoisRecord.find_by(name: x).save} end end From f1b5ede74bf3ec0b289ec6b23160179f59f0cde1 Mon Sep 17 00:00:00 2001 From: Georg Kahest Date: Tue, 8 Dec 2015 13:52:56 +0200 Subject: [PATCH 2/2] after save --- app/models/contact.rb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/models/contact.rb b/app/models/contact.rb index 6fbc74325..dace4d968 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