Status import improvements #2267

This commit is contained in:
Martin Lensment 2015-06-16 12:42:29 +03:00
parent 0f765b1ff0
commit bed27ce940
2 changed files with 21 additions and 43 deletions

View file

@ -128,7 +128,6 @@ class Domain < ActiveRecord::Base
errors.add(:statuses, :taken)
end
attr_accessor :registrant_typeahead, :update_me, :deliver_emails,
:epp_pending_update, :epp_pending_delete
@ -207,8 +206,8 @@ class Domain < ActiveRecord::Base
STDOUT << "#{Time.zone.now.utc} - Destroying domains\n" unless Rails.env.test?
c = 0
DomainStatus.where(value: DomainStatus::DELETE_CANDIDATE).each do |x|
x.domain.destroy
Domain.where("statuses @> '{deleteCandidate}'::varchar[]").each do |x|
x.destroy
c += 1
end