Skip to content

Commit

Permalink
refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
Oleg Hasjanov committed Apr 8, 2021
1 parent 1cc6f25 commit f468686
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions app/models/domain.rb
Original file line number Diff line number Diff line change
Expand Up @@ -559,16 +559,20 @@ def delete_prohibited?
statuses.include?(DomainStatus::FORCE_DELETE)
end

def update_unless_locked_by_registrant(update)
update(admin_store_statuses_history: update) unless locked_by_registrant?
end

# special handling for admin changing status
def admin_status_update(update)
# check for deleted status
update(admin_store_statuses_history: update) unless locked_by_registrant?
update_unless_locked_by_registrant(update)

if locked_by_registrant?
result = update.reject { |status| LOCK_STATUSES.include? status }
update(admin_store_statuses_history: result)
end


# check for deleted status
statuses.each do |s|
unless update.include? s
case s
Expand Down

0 comments on commit f468686

Please sign in to comment.