mirror of
https://github.com/internetee/registry.git
synced 2025-05-20 19:29:39 +02:00
Prefixes to statuses are added now automatically in client
This commit is contained in:
parent
96eead47b7
commit
5083062de4
4 changed files with 23 additions and 2 deletions
|
@ -18,6 +18,8 @@ class Client::DomainsController < ClientController
|
|||
end
|
||||
|
||||
def create
|
||||
add_prefix_to_statuses
|
||||
|
||||
@domain = Domain.new(domain_params)
|
||||
@domain.registrar = current_user.registrar
|
||||
|
||||
|
@ -36,6 +38,8 @@ class Client::DomainsController < ClientController
|
|||
end
|
||||
|
||||
def update
|
||||
add_prefix_to_statuses
|
||||
|
||||
if @domain.update(domain_params)
|
||||
flash[:notice] = I18n.t('shared.domain_updated')
|
||||
redirect_to [:client, @domain]
|
||||
|
@ -71,6 +75,12 @@ class Client::DomainsController < ClientController
|
|||
)
|
||||
end
|
||||
|
||||
def add_prefix_to_statuses
|
||||
domain_params[:domain_statuses_attributes].each do |_k, hash|
|
||||
hash[:value] = hash[:value].prepend('client')
|
||||
end
|
||||
end
|
||||
|
||||
def set_domain
|
||||
@domain = Domain.find(params[:id])
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue