mirror of
https://github.com/internetee/registry.git
synced 2025-05-28 16:39:55 +02:00
Prefixes to statuses are added no automatically in admin
This commit is contained in:
parent
5083062de4
commit
69a0d3938f
3 changed files with 18 additions and 1 deletions
|
@ -15,6 +15,8 @@ class Admin::DomainsController < AdminController
|
|||
end
|
||||
|
||||
def update
|
||||
add_prefix_to_statuses
|
||||
|
||||
if @domain.update(domain_params)
|
||||
flash[:notice] = I18n.t('shared.domain_updated')
|
||||
redirect_to [:admin, @domain]
|
||||
|
@ -36,4 +38,10 @@ class Admin::DomainsController < AdminController
|
|||
domain_statuses_attributes: [:id, :value, :description, :_destroy]
|
||||
)
|
||||
end
|
||||
|
||||
def add_prefix_to_statuses
|
||||
domain_params[:domain_statuses_attributes].each do |_k, hash|
|
||||
hash[:value] = hash[:value].prepend('server')
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue