shared_draft_zoom.rb 768 B

123456789101112131415161718192021222324252627282930313233
  1. # Copyright (C) 2012-2022 Zammad Foundation, https://zammad-foundation.org/
  2. class Ticket::SharedDraftZoom < ApplicationModel
  3. include CanCloneAttachments
  4. include ChecksClientNotification
  5. include HasHistory
  6. belongs_to :ticket, touch: true
  7. belongs_to :created_by, class_name: 'User'
  8. belongs_to :updated_by, class_name: 'User'
  9. store :new_article
  10. store :ticket_attributes
  11. history_attributes_ignored :new_article,
  12. :ticket_attributes
  13. # required by CanCloneAttachments
  14. def content_type
  15. 'text/html'
  16. end
  17. def history_log_attributes
  18. {
  19. related_o_id: self['ticket_id'],
  20. related_history_object: 'Ticket',
  21. }
  22. end
  23. def history_destroy
  24. history_log('removed', created_by_id)
  25. end
  26. end