2021-06-01 12:20:20 +00:00
|
|
|
# Copyright (C) 2012-2021 Zammad Foundation, http://zammad-foundation.org/
|
|
|
|
|
2020-09-08 15:06:23 +00:00
|
|
|
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
|