mirror of
https://github.com/internetee/registry.git
synced 2025-05-19 10:49:39 +02:00
Refactor #2623
This commit is contained in:
parent
1e5eb158e5
commit
34014cf5f7
3 changed files with 4 additions and 5 deletions
|
@ -61,7 +61,6 @@ class Admin::DomainsController < AdminController
|
|||
end
|
||||
|
||||
def build_associations
|
||||
@domain.domain_statuses.build if @domain.domain_statuses.empty?
|
||||
@server_statuses = @domain.statuses.select { |x| DomainStatus::SERVER_STATUSES.include?(x) }
|
||||
@server_statuses = [nil] if @server_statuses.empty?
|
||||
@other_statuses = @domain.statuses.select { |x| !DomainStatus::SERVER_STATUSES.include?(x) }
|
||||
|
|
|
@ -288,8 +288,8 @@ class Domain < ActiveRecord::Base
|
|||
def clean_pendings!
|
||||
preclean_pendings
|
||||
self.pending_json = {}
|
||||
domain_statuses.where(value: DomainStatus::PENDING_UPDATE).destroy_all
|
||||
domain_statuses.where(value: DomainStatus::PENDING_DELETE).destroy_all
|
||||
statuses.delete(DomainStatus::PENDING_UPDATE)
|
||||
statuses.delete(DomainStatus::PENDING_DELETE)
|
||||
save
|
||||
end
|
||||
|
||||
|
|
|
@ -383,8 +383,8 @@ class Epp::Domain < Domain
|
|||
preclean_pendings
|
||||
user = ApiUser.find(pending_json['current_user_id'])
|
||||
frame = Nokogiri::XML(pending_json['frame'])
|
||||
domain_statuses.where(value: DomainStatus::PENDING_UPDATE).destroy_all
|
||||
domain_statuses.reload
|
||||
statuses.delete(DomainStatus::PENDING_UPDATE)
|
||||
|
||||
if update(frame, user, false)
|
||||
clean_pendings!
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue