2022-02-24 11:33:52 +00:00
|
|
|
# Copyright (C) 2012-2022 Zammad Foundation, https://zammad-foundation.org/
|
|
|
|
|
|
|
|
class Ticket::SharedDraftZoom < ApplicationModel
|
|
|
|
include CanCloneAttachments
|
|
|
|
include ChecksClientNotification
|
2022-03-02 12:55:30 +00:00
|
|
|
include HasHistory
|
2022-02-24 11:33:52 +00:00
|
|
|
|
|
|
|
belongs_to :ticket, touch: true
|
2022-03-02 12:55:30 +00:00
|
|
|
belongs_to :created_by, class_name: 'User'
|
|
|
|
belongs_to :updated_by, class_name: 'User'
|
2022-02-24 11:33:52 +00:00
|
|
|
|
|
|
|
store :new_article
|
|
|
|
store :ticket_attributes
|
|
|
|
|
2022-03-02 12:55:30 +00:00
|
|
|
history_attributes_ignored :new_article,
|
|
|
|
:ticket_attributes
|
|
|
|
|
2022-02-24 11:33:52 +00:00
|
|
|
# required by CanCloneAttachments
|
|
|
|
def content_type
|
|
|
|
'text/html'
|
|
|
|
end
|
2022-03-02 12:55:30 +00:00
|
|
|
|
|
|
|
def history_log_attributes
|
|
|
|
{
|
|
|
|
related_o_id: self['ticket_id'],
|
|
|
|
related_history_object: 'Ticket',
|
|
|
|
}
|
|
|
|
end
|
|
|
|
|
|
|
|
def history_destroy
|
|
|
|
history_log('removed', created_by_id)
|
|
|
|
end
|
2022-02-24 11:33:52 +00:00
|
|
|
end
|