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
|
end
|
||||||
|
|
||||||
def build_associations
|
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 = @domain.statuses.select { |x| DomainStatus::SERVER_STATUSES.include?(x) }
|
||||||
@server_statuses = [nil] if @server_statuses.empty?
|
@server_statuses = [nil] if @server_statuses.empty?
|
||||||
@other_statuses = @domain.statuses.select { |x| !DomainStatus::SERVER_STATUSES.include?(x) }
|
@other_statuses = @domain.statuses.select { |x| !DomainStatus::SERVER_STATUSES.include?(x) }
|
||||||
|
|
|
@ -288,8 +288,8 @@ class Domain < ActiveRecord::Base
|
||||||
def clean_pendings!
|
def clean_pendings!
|
||||||
preclean_pendings
|
preclean_pendings
|
||||||
self.pending_json = {}
|
self.pending_json = {}
|
||||||
domain_statuses.where(value: DomainStatus::PENDING_UPDATE).destroy_all
|
statuses.delete(DomainStatus::PENDING_UPDATE)
|
||||||
domain_statuses.where(value: DomainStatus::PENDING_DELETE).destroy_all
|
statuses.delete(DomainStatus::PENDING_DELETE)
|
||||||
save
|
save
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -383,8 +383,8 @@ class Epp::Domain < Domain
|
||||||
preclean_pendings
|
preclean_pendings
|
||||||
user = ApiUser.find(pending_json['current_user_id'])
|
user = ApiUser.find(pending_json['current_user_id'])
|
||||||
frame = Nokogiri::XML(pending_json['frame'])
|
frame = Nokogiri::XML(pending_json['frame'])
|
||||||
domain_statuses.where(value: DomainStatus::PENDING_UPDATE).destroy_all
|
statuses.delete(DomainStatus::PENDING_UPDATE)
|
||||||
domain_statuses.reload
|
|
||||||
if update(frame, user, false)
|
if update(frame, user, false)
|
||||||
clean_pendings!
|
clean_pendings!
|
||||||
end
|
end
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue