trabajo-afectivo/app/models/ticket/shared_draft_zoom.rb

34 lines
768 B
Ruby
Raw Permalink Normal View History

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
include HasHistory
2022-02-24 11:33:52 +00:00
belongs_to :ticket, touch: true
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
history_attributes_ignored :new_article,
:ticket_attributes
2022-02-24 11:33:52 +00:00
# required by CanCloneAttachments
def content_type
'text/html'
end
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