mirror of
https://github.com/internetee/registry.git
synced 2025-08-04 00:42:04 +02:00
Let domain to to draft status
This commit is contained in:
parent
e9e1e057f5
commit
7f26c8c769
6 changed files with 32 additions and 14 deletions
|
@ -39,11 +39,9 @@ class Domain < ActiveRecord::Base
|
|||
|
||||
validates :name_dirty, domain_name: true, uniqueness: true
|
||||
validates :period, numericality: { only_integer: true }
|
||||
validates :name, :owner_contact, presence: true
|
||||
validates :owner_contact, presence: true
|
||||
|
||||
validate :validate_period
|
||||
validate :validate_nameservers_count
|
||||
validate :validate_admin_contacts_count
|
||||
|
||||
def name=(value)
|
||||
value.strip!
|
||||
|
@ -54,8 +52,7 @@ class Domain < ActiveRecord::Base
|
|||
|
||||
### CREATE & UPDATE ###
|
||||
|
||||
def parse_and_attach_domain_dependencies(ph, parsed_frame)
|
||||
attach_owner_contact(ph[:registrant]) if ph[:registrant]
|
||||
def parse_and_attach_domain_dependencies(parsed_frame)
|
||||
attach_contacts(self.class.parse_contacts_from_frame(parsed_frame))
|
||||
attach_nameservers(self.class.parse_nameservers_from_frame(parsed_frame))
|
||||
attach_statuses(self.class.parse_statuses_from_frame(parsed_frame))
|
||||
|
@ -300,6 +297,13 @@ class Domain < ActiveRecord::Base
|
|||
add_epp_error('2306', 'curExpDate', cur_exp_date, I18n.t('errors.messages.epp_exp_dates_do_not_match'))
|
||||
end
|
||||
|
||||
def all_dependencies_valid?
|
||||
validate_nameservers_count
|
||||
validate_admin_contacts_count
|
||||
|
||||
errors.empty?
|
||||
end
|
||||
|
||||
def epp_code_map # rubocop:disable Metrics/MethodLength
|
||||
domain_validation_sg = SettingGroup.domain_validation
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue