23 lines
382 B
Ruby
23 lines
382 B
Ruby
# Copyright (C) 2012-2022 Zammad Foundation, https://zammad-foundation.org/
|
|
|
|
module HasTaskbars
|
|
extend ActiveSupport::Concern
|
|
|
|
included do
|
|
before_destroy :destroy_taskbars
|
|
end
|
|
|
|
=begin
|
|
|
|
destroy all taskbars for the class object id
|
|
|
|
model = Model.find(123)
|
|
model.destroy
|
|
|
|
=end
|
|
|
|
def destroy_taskbars
|
|
Taskbar.where(key: "#{self.class}-#{id}").destroy_all
|
|
end
|
|
|
|
end
|