mirror of
https://github.com/internetee/registry.git
synced 2025-05-20 11:19:39 +02:00
Create domain works with nested attributes
This commit is contained in:
parent
037cb57e00
commit
27d19ad237
4 changed files with 124 additions and 6 deletions
|
@ -41,6 +41,7 @@ class Domain < ActiveRecord::Base
|
|||
reject_if: proc { |attrs| attrs[:public_key].blank? }
|
||||
|
||||
has_many :legal_documents, as: :documentable
|
||||
accepts_nested_attributes_for :legal_documents, reject_if: proc { |attrs| attrs[:body].blank? }
|
||||
|
||||
delegate :code, to: :owner_contact, prefix: true
|
||||
delegate :email, to: :owner_contact, prefix: true
|
||||
|
|
|
@ -2,6 +2,8 @@
|
|||
class Epp::EppDomain < Domain
|
||||
include EppErrors
|
||||
|
||||
accepts_nested_attributes_for :nameservers
|
||||
|
||||
def epp_code_map # rubocop:disable Metrics/MethodLength
|
||||
{
|
||||
'2002' => [
|
||||
|
@ -58,6 +60,21 @@ class Epp::EppDomain < Domain
|
|||
}
|
||||
end
|
||||
|
||||
def self.new_from_epp(domain_params)
|
||||
new(domain_params)
|
||||
end
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
def parse_and_attach_domain_dependencies(parsed_frame)
|
||||
attach_owner_contact(self.class.parse_owner_contact_from_frame(parsed_frame))
|
||||
attach_contacts(self.class.parse_contacts_from_frame(parsed_frame))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue