mirror of
https://github.com/internetee/registry.git
synced 2025-07-25 03:58:27 +02:00
implement domain statuses restore after domain locked, added test
This commit is contained in:
parent
90cb154d15
commit
28a54d6612
6 changed files with 645 additions and 885 deletions
|
@ -1,6 +1,8 @@
|
|||
module Domain::RegistryLockable
|
||||
extend ActiveSupport::Concern
|
||||
|
||||
# status_notes public.hstore,
|
||||
|
||||
LOCK_STATUSES = [DomainStatus::SERVER_UPDATE_PROHIBITED,
|
||||
DomainStatus::SERVER_DELETE_PROHIBITED,
|
||||
DomainStatus::SERVER_TRANSFER_PROHIBITED].freeze
|
||||
|
@ -9,6 +11,12 @@ module Domain::RegistryLockable
|
|||
return unless registry_lockable?
|
||||
return if locked_by_registrant?
|
||||
|
||||
self.locked_domain_statuses_history = self.statuses.map do |status|
|
||||
if LOCK_STATUSES.include? status
|
||||
status
|
||||
end
|
||||
end
|
||||
|
||||
transaction do
|
||||
self.statuses |= LOCK_STATUSES
|
||||
self.locked_by_registrant_at = Time.zone.now
|
||||
|
@ -36,7 +44,9 @@ module Domain::RegistryLockable
|
|||
|
||||
transaction do
|
||||
LOCK_STATUSES.each do |domain_status|
|
||||
statuses.delete(domain_status)
|
||||
unless self.locked_domain_statuses_history.include? domain_status
|
||||
statuses.delete(domain_status)
|
||||
end
|
||||
end
|
||||
self.locked_by_registrant_at = nil
|
||||
alert_registrar_lock_changes!(lock: false)
|
||||
|
|
|
@ -16,6 +16,9 @@ class Domain < ApplicationRecord
|
|||
|
||||
attr_accessor :legal_document_id
|
||||
|
||||
# serialize :json_statuses_history, HashSerializer
|
||||
store_accessor :json_statuses_history, :force_delete_domain_statuses_history, :locked_domain_statuses_history
|
||||
|
||||
alias_attribute :on_hold_time, :outzone_at
|
||||
alias_attribute :outzone_time, :outzone_at
|
||||
alias_attribute :auth_info, :transfer_code # Old attribute name; for PaperTrail
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue