mirror of
https://github.com/internetee/registry.git
synced 2025-05-17 17:59:47 +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
|
@ -11,7 +11,7 @@ class Admin::DomainsController < AdminController
|
|||
end
|
||||
|
||||
def edit
|
||||
@domain.domain_statuses.build if @domain.domain_statuses.empty?
|
||||
build_associations
|
||||
end
|
||||
|
||||
def update
|
||||
|
@ -39,9 +39,15 @@ class Admin::DomainsController < AdminController
|
|||
)
|
||||
end
|
||||
|
||||
def build_associations
|
||||
@domain.domain_statuses.build if @domain.domain_statuses.empty?
|
||||
@server_statuses = @domain.domain_statuses.select(&:server_status?)
|
||||
@server_statuses << @domain.domain_statuses.build if @server_statuses.empty?
|
||||
end
|
||||
|
||||
def add_prefix_to_statuses
|
||||
domain_params[:domain_statuses_attributes].each do |_k, hash|
|
||||
hash[:value] = hash[:value].prepend('server')
|
||||
hash[:value] = hash[:value].prepend('server') if hash[:value].present?
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue