mirror of
https://github.com/internetee/registry.git
synced 2025-05-17 17:59:47 +02:00
1150040781-contact_delete_legal_doc
This commit is contained in:
parent
9e32f71d2f
commit
431eaf5439
2 changed files with 6 additions and 2 deletions
|
@ -330,11 +330,15 @@ class Contact < ActiveRecord::Base
|
|||
# TODO: refactor, it should not allow to destroy with normal destroy,
|
||||
# no need separate method
|
||||
# should use only in transaction
|
||||
def destroy_and_clean
|
||||
def destroy_and_clean frame
|
||||
if domains_present?
|
||||
errors.add(:domains, :exist)
|
||||
return false
|
||||
end
|
||||
if doc = Epp::Contact.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
|
||||
destroy
|
||||
end
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue