mirror of
https://github.com/internetee/registry.git
synced 2025-05-19 10:49:39 +02:00
Client domain edit cant see server statuses and vice versa
This commit is contained in:
parent
69a0d3938f
commit
fa12a31063
6 changed files with 29 additions and 22 deletions
|
@ -39,7 +39,6 @@ class Client::DomainsController < ClientController
|
|||
|
||||
def update
|
||||
add_prefix_to_statuses
|
||||
|
||||
if @domain.update(domain_params)
|
||||
flash[:notice] = I18n.t('shared.domain_updated')
|
||||
redirect_to [:client, @domain]
|
||||
|
@ -77,7 +76,7 @@ class Client::DomainsController < ClientController
|
|||
|
||||
def add_prefix_to_statuses
|
||||
domain_params[:domain_statuses_attributes].each do |_k, hash|
|
||||
hash[:value] = hash[:value].prepend('client')
|
||||
hash[:value] = hash[:value].prepend('client') if hash[:value].present?
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -88,7 +87,9 @@ class Client::DomainsController < ClientController
|
|||
def build_associations
|
||||
@domain.nameservers.build if @domain.nameservers.empty?
|
||||
@domain.domain_contacts.build if @domain.domain_contacts.empty?
|
||||
@domain.domain_statuses.build if @domain.domain_statuses.empty?
|
||||
|
||||
@client_statuses = @domain.domain_statuses.select(&:client_status?)
|
||||
@client_statuses << @domain.domain_statuses.build if @client_statuses.empty?
|
||||
end
|
||||
|
||||
def verify_deletion
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue