From b8bc341bee219fe9e0eeaee817a566a02698a4dd Mon Sep 17 00:00:00 2001 From: Vladimir Krylov Date: Mon, 3 Oct 2016 14:01:21 +0300 Subject: [PATCH] Story#119627029 registrar is not part of contacts (cherry picked from commit d390045) --- app/models/legal_document.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/models/legal_document.rb b/app/models/legal_document.rb index f6418dfc2..13fbdf049 100644 --- a/app/models/legal_document.rb +++ b/app/models/legal_document.rb @@ -85,8 +85,8 @@ class LegalDocument < ActiveRecord::Base end contact_ids = DomainVersion.where(item_id: orig_legal.documentable_id).distinct. - pluck("object->>'registrar_id'", "object->>'registrant_id'", "object_changes->>'registrar_id'", - "object_changes->>'registrant_id'", "children->>'tech_contacts'", "children->>'admin_contacts'").flatten.uniq + pluck("object->>'registrant_id'", "object_changes->>'registrant_id'", + "children->>'tech_contacts'", "children->>'admin_contacts'").flatten.uniq contact_ids = contact_ids.map{|id| id.is_a?(Hash) ? id["id"] : id}.flatten.compact.uniq LegalDocument.where(documentable_type: "Contact", documentable_id: contact_ids). where(checksum: orig_legal.checksum).where.not(path: orig_legal.path).each do |new_legal|