From 71212a575613c7b05c296dd21735308dd6fccfa0 Mon Sep 17 00:00:00 2001 From: teadur Date: Wed, 2 Dec 2015 20:35:06 +0200 Subject: [PATCH 1/7] Update whois.rb fix issue #1 --- app/views/for_models/whois.erb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/views/for_models/whois.erb b/app/views/for_models/whois.erb index cb6adac75..f1eba3ecf 100644 --- a/app/views/for_models/whois.erb +++ b/app/views/for_models/whois.erb @@ -17,7 +17,7 @@ email: Not Disclosed - Visit www.internet.ee for webbased WHOIS changed: <%= json['changed'].to_s.tr('T',' ').sub('+', ' +') %> <%- if json['admin_contacts'].present? -%> -Administrative contact +Administrative contact: <%- for contact in json['admin_contacts'] -%> name: <%= contact['name'] %> email: Not Disclosed - Visit www.internet.ee for webbased WHOIS @@ -57,4 +57,4 @@ changed: <%= json['dnssec_changed'].to_s.tr('T',' ').sub('+', ' +') %> <%- end -%> Estonia .ee Top Level Domain WHOIS server -More information at http://internet.ee \ No newline at end of file +More information at http://internet.ee From 5edab4fbe6e78c98176697a97e2bf811c8579309 Mon Sep 17 00:00:00 2001 From: teadur Date: Thu, 3 Dec 2015 17:16:19 +0200 Subject: [PATCH 2/7] Update contact.md --- doc/epp/contact.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/epp/contact.md b/doc/epp/contact.md index 5e45e491b..5db5ba3b4 100644 --- a/doc/epp/contact.md +++ b/doc/epp/contact.md @@ -34,7 +34,7 @@ Contact Mapping protocol short version: Attribute: "type" "org" # Business registry code "priv" # National idendtification number - "birthday" # Birthday date in format in DD-MM-YYYY + "birthday" # Birthday date in format in YYYY-MM-DD Attribute: "cc" "EE" # Country code in ISO_3166-1 aplha 2 0-1 Base64 encoded document @@ -70,7 +70,7 @@ Contact Mapping protocol short version: Attribute: "type" "org" # Business registry code "priv" # National idendtification number - "birthday" # Birthday date in format in DD-MM-YYYY + "birthday" # Birthday date in format in YYYY-MM-DD Attribute: "cc" "EE" # Country code in ISO_3166-1 aplha 2 0-1 Base64 encoded document. From 746e1816b4eeece7838703a2a07dec70c8e29a1d Mon Sep 17 00:00:00 2001 From: Georg Kahest Date: Thu, 3 Dec 2015 17:41:28 +0200 Subject: [PATCH 3/7] whois fix updated time --- app/models/whois_record.rb | 2 +- app/views/for_models/whois.erb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/models/whois_record.rb b/app/models/whois_record.rb index ac5f17c7b..21db2bdc0 100644 --- a/app/models/whois_record.rb +++ b/app/models/whois_record.rb @@ -50,7 +50,7 @@ class WhoisRecord < ActiveRecord::Base h[:registrant] = domain.registrant.name h[:registrant_email] = domain.registrant.email @disclosed << [:email, domain.registrant.email] - h[:changed] = domain.registrant.updated_at.try(:to_s, :iso8601) + h[:registrant_changed] = domain.registrant.updated_at.try(:to_s, :iso8601) h[:admin_contacts] = [] domain.admin_contacts.each do |ac| diff --git a/app/views/for_models/whois.erb b/app/views/for_models/whois.erb index f1eba3ecf..030f10d51 100644 --- a/app/views/for_models/whois.erb +++ b/app/views/for_models/whois.erb @@ -14,7 +14,7 @@ delete: <%= json['delete'].to_s.tr('T',' ').sub('+', ' +') %> Registrant: name: <%= json['registrant'] %> email: Not Disclosed - Visit www.internet.ee for webbased WHOIS -changed: <%= json['changed'].to_s.tr('T',' ').sub('+', ' +') %> +changed: <%= json['registrant_changed'].to_s.tr('T',' ').sub('+', ' +') %> <%- if json['admin_contacts'].present? -%> Administrative contact: From bdd5473d278e4b4f7b8cd338a9744f0b692ab5df Mon Sep 17 00:00:00 2001 From: Georg Kahest Date: Thu, 3 Dec 2015 18:45:07 +0200 Subject: [PATCH 4/7] domain updated at --- app/models/whois_record.rb | 2 +- app/views/for_models/whois.erb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/models/whois_record.rb b/app/models/whois_record.rb index 21db2bdc0..b0c6eca03 100644 --- a/app/models/whois_record.rb +++ b/app/models/whois_record.rb @@ -41,7 +41,7 @@ class WhoisRecord < ActiveRecord::Base h[:name] = domain.name h[:status] = domain.statuses.map { |x| status_map[x] || x } h[:registered] = domain.registered_at.try(:to_s, :iso8601) - h[:changed] = domain.updated_at.try(:to_s, :iso8601) + h[:domain_changed] = domain.updated_at.try(:to_s, :iso8601) h[:expire] = domain.valid_to.try(:to_date).try(:to_s) h[:outzone] = domain.outzone_at.try(:to_date).try(:to_s) h[:delete] = domain.delete_at.try(:to_date).try(:to_s) diff --git a/app/views/for_models/whois.erb b/app/views/for_models/whois.erb index 030f10d51..cfac6b01a 100644 --- a/app/views/for_models/whois.erb +++ b/app/views/for_models/whois.erb @@ -6,7 +6,7 @@ name: <%= json['name'] %> status: <%= st %> <%- end -%> registered: <%= json['registered'].to_s.tr('T',' ').sub('+', ' +') %> -changed: <%= json['changed'].to_s.tr('T',' ').sub('+', ' +') %> +changed: <%= json['domain_changed'].to_s.tr('T',' ').sub('+', ' +') %> expire: <%= json['expire'].to_s.tr('T',' ').sub('+', ' +') %> outzone: <%= json['outzone'].to_s.tr('T',' ').sub('+', ' +') %> delete: <%= json['delete'].to_s.tr('T',' ').sub('+', ' +') %> From d8c879e377b0ecdbe221a6d949e35d2151a8f85e Mon Sep 17 00:00:00 2001 From: Georg Kahest Date: Fri, 4 Dec 2015 12:47:43 +0200 Subject: [PATCH 5/7] domain_changed revert --- app/models/whois_record.rb | 2 +- app/views/for_models/whois.erb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/models/whois_record.rb b/app/models/whois_record.rb index b0c6eca03..21db2bdc0 100644 --- a/app/models/whois_record.rb +++ b/app/models/whois_record.rb @@ -41,7 +41,7 @@ class WhoisRecord < ActiveRecord::Base h[:name] = domain.name h[:status] = domain.statuses.map { |x| status_map[x] || x } h[:registered] = domain.registered_at.try(:to_s, :iso8601) - h[:domain_changed] = domain.updated_at.try(:to_s, :iso8601) + h[:changed] = domain.updated_at.try(:to_s, :iso8601) h[:expire] = domain.valid_to.try(:to_date).try(:to_s) h[:outzone] = domain.outzone_at.try(:to_date).try(:to_s) h[:delete] = domain.delete_at.try(:to_date).try(:to_s) diff --git a/app/views/for_models/whois.erb b/app/views/for_models/whois.erb index cfac6b01a..030f10d51 100644 --- a/app/views/for_models/whois.erb +++ b/app/views/for_models/whois.erb @@ -6,7 +6,7 @@ name: <%= json['name'] %> status: <%= st %> <%- end -%> registered: <%= json['registered'].to_s.tr('T',' ').sub('+', ' +') %> -changed: <%= json['domain_changed'].to_s.tr('T',' ').sub('+', ' +') %> +changed: <%= json['changed'].to_s.tr('T',' ').sub('+', ' +') %> expire: <%= json['expire'].to_s.tr('T',' ').sub('+', ' +') %> outzone: <%= json['outzone'].to_s.tr('T',' ').sub('+', ' +') %> delete: <%= json['delete'].to_s.tr('T',' ').sub('+', ' +') %> From 8726735271fb07d518cfce823f87c3c87b5e9cdf Mon Sep 17 00:00:00 2001 From: root Date: Sat, 5 Dec 2015 22:47:15 +0200 Subject: [PATCH 6/7] 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 af42d5c10..8da27b86d 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 06b81c8f4f75431d99682e8ebc307f55eb8e9dea Mon Sep 17 00:00:00 2001 From: root Date: Sat, 5 Dec 2015 22:55:31 +0200 Subject: [PATCH 7/7] 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 8da27b86d..c6a0d66c0 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