From e4cdd23248321ae966ba9b5a6853b2d463fdb489 Mon Sep 17 00:00:00 2001 From: Vladimir Krylov Date: Thu, 7 Apr 2016 16:05:52 +0300 Subject: [PATCH] story#115762063 - revert how children ids are saved --- app/models/domain.rb | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/app/models/domain.rb b/app/models/domain.rb index a7815c9ce..86b6d4a60 100644 --- a/app/models/domain.rb +++ b/app/models/domain.rb @@ -729,13 +729,12 @@ class Domain < ActiveRecord::Base # small optimization that we'are using to_a if it was done already # otherwise just getting ids def children_log - log = HashWithIndifferentAccess.new - types = %i(admin_contacts tech_contacts nameservers dnskeys domain_statuses) - - types.each do |rel| - ids = send(rel).loaded? ? send(rel).reject(&:marked_for_destruction?).map(&:id) : send(rel).pluck(:id) - log[rel] = ids - end + log = HashWithIndifferentAccess.new + log[:admin_contacts] = admin_contact_ids + log[:tech_contacts] = tech_contact_ids + log[:nameservers] = nameserver_ids + log[:domain_statuses]= domain_status_ids + log[:dnskeys] = dnskey_ids log[:registrant] = [registrant_id] log end