mirror of
https://github.com/internetee/registry.git
synced 2025-05-28 12:31:21 +02:00
Story#114471339 - move parse_legal_document_from_frame to one braking point
This commit is contained in:
parent
7a659da6a3
commit
30fe6bd1e6
1 changed files with 2 additions and 14 deletions
|
@ -150,7 +150,7 @@ class Epp::Contact < Contact
|
|||
legal_frame = frame.css('legalDocument').first
|
||||
at[:legal_documents_attributes] = self.class.legal_document_attrs(legal_frame)
|
||||
|
||||
if doc = attach_legal_document(parse_legal_document_from_frame(frame))
|
||||
if doc = attach_legal_document(Epp::Domain.parse_legal_document_from_frame(frame))
|
||||
frame.css("legalDocument").first.content = doc.path if doc && doc.persisted?
|
||||
self.legal_document_id = doc.id
|
||||
end
|
||||
|
@ -227,7 +227,7 @@ class Epp::Contact < Contact
|
|||
end
|
||||
|
||||
def add_legal_file_to_new frame
|
||||
legal_document_data = Epp::Contact.parse_legal_document_from_frame(frame)
|
||||
legal_document_data = Epp::Domain.parse_legal_document_from_frame(frame)
|
||||
return unless legal_document_data
|
||||
|
||||
doc = LegalDocument.create(
|
||||
|
@ -242,16 +242,4 @@ class Epp::Contact < Contact
|
|||
self.legal_document_id = doc.id
|
||||
end
|
||||
|
||||
|
||||
def parse_legal_document_from_frame frame
|
||||
ld = frame.css('legalDocument').first
|
||||
return nil unless ld
|
||||
return nil if ld.text.starts_with?(ENV['legal_documents_dir'])
|
||||
|
||||
{
|
||||
body: ld.text,
|
||||
type: ld['type']
|
||||
}
|
||||
end
|
||||
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue