mirror of
https://github.com/internetee/registry.git
synced 2025-07-14 06:55:11 +02:00
Show status error in domain update request
This commit is contained in:
parent
8697f8eabb
commit
1b4779de0e
3 changed files with 24 additions and 5 deletions
|
@ -127,7 +127,15 @@ class Domain < ActiveRecord::Base
|
|||
|
||||
def attach_statuses(status_list)
|
||||
status_list.each do |x|
|
||||
existing = domain_statuses.select { |o| o.value == x[:value] }
|
||||
|
||||
if existing.any?
|
||||
add_epp_error('2302', 'status', x[:value], [:domain_statuses, :taken])
|
||||
next
|
||||
end
|
||||
|
||||
setting = SettingGroup.domain_statuses.settings.find_by(value: x[:value])
|
||||
|
||||
domain_statuses.build(
|
||||
setting: setting,
|
||||
description: x[:description]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue