added test and saving statuses into histroy field

This commit is contained in:
olegphenomenon 2021-09-23 11:01:34 +03:00
parent 622dba4f1c
commit 09eab21d2b
9 changed files with 34 additions and 183 deletions

View file

@ -122,7 +122,7 @@ class Domain < ApplicationRecord
def status_is_consistant
has_error = (hold_status? && statuses.include?(DomainStatus::SERVER_MANUAL_INZONE))
if !has_error && (statuses & DELETE_STATUSES).any?
has_error = statuses.include? DomainStatus::SERVER_DELETE_PROHIBITED
has_error = statuses.include? DomainStatus::SERVER_DELETE_PROHIBITED unless locked_by_registrant?
end
errors.add(:domains, I18n.t(:object_status_prohibits_operation)) if has_error
end