mirror of
https://github.com/internetee/registry.git
synced 2025-08-03 00:12:03 +02:00
Story#116761157 - move variable when to delete orphans to settings
This commit is contained in:
parent
35a67ce439
commit
01234e3c55
4 changed files with 4 additions and 1 deletions
|
@ -185,7 +185,7 @@ class Contact < ActiveRecord::Base
|
|||
%w(admin_contacts tech_contacts registrant).each do |type|
|
||||
ver_scope << "(children->'#{type}')::jsonb <@ json_build_array(#{contact.id})::jsonb"
|
||||
end
|
||||
next if DomainVersion.where("created_at > ?", Time.now - 6.months).where(ver_scope.join(" OR ")).any?
|
||||
next if DomainVersion.where("created_at > ?", Time.now - Setting.orphans_contacts_in_months.to_i.months).where(ver_scope.join(" OR ")).any?
|
||||
next if contact.domains_present?
|
||||
|
||||
contact.destroy
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue