Use central method for appending legaldocs to domains/contacts

This commit is contained in:
Karl Erik Õunapuu 2020-12-29 15:21:03 +02:00
parent 7caa544c83
commit 50bf708b6a
No known key found for this signature in database
GPG key ID: C9DD647298A34764
10 changed files with 61 additions and 73 deletions

View file

@ -59,15 +59,7 @@ module Actions
end
def maybe_attach_legal_doc
return unless legal_document
doc = LegalDocument.create(
documentable_type: Contact,
document_type: legal_document[:type], body: legal_document[:body]
)
contact.legal_documents = [doc]
contact.legal_document_id = doc.id
Actions::BaseAction.attach_legal_doc_to_new(contact, legal_document, domain: false)
end
def commit