shared_draft_zoom.rb 718 B

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