From cf2a1222173465d5b544ffddd5c6624b955ef6e7 Mon Sep 17 00:00:00 2001 From: Thorsten Eckel Date: Thu, 18 Mar 2021 08:34:51 +0100 Subject: [PATCH] Maintenance: Removed deprecated Observers that have already been migrated to ActiveJob. --- .../observer/chat/leave/background_job.rb | 15 ---------- .../communicate_facebook/background_job.rb | 13 -------- .../article/communicate_sms/background_job.rb | 13 -------- .../communicate_telegram/background_job.rb | 13 -------- .../communicate_twitter/background_job.rb | 13 -------- app/models/transaction/background_job.rb | 30 ------------------- 6 files changed, 97 deletions(-) delete mode 100644 app/models/observer/chat/leave/background_job.rb delete mode 100644 app/models/observer/ticket/article/communicate_facebook/background_job.rb delete mode 100644 app/models/observer/ticket/article/communicate_sms/background_job.rb delete mode 100644 app/models/observer/ticket/article/communicate_telegram/background_job.rb delete mode 100644 app/models/observer/ticket/article/communicate_twitter/background_job.rb delete mode 100644 app/models/transaction/background_job.rb diff --git a/app/models/observer/chat/leave/background_job.rb b/app/models/observer/chat/leave/background_job.rb deleted file mode 100644 index f4b615f88..000000000 --- a/app/models/observer/chat/leave/background_job.rb +++ /dev/null @@ -1,15 +0,0 @@ -class Observer::Chat::Leave::BackgroundJob - def initialize(chat_session_id, client_id, session) - @chat_session_id = chat_session_id - @client_id = client_id - @session = session - end - - def perform - if Gem::Version.new(Version.get) >= Gem::Version.new('4.0.x') - ActiveSupport::Deprecation.warn("This file has been migrated to the ActiveJob 'ChatLeaveJob' and is therefore deprecated and should get removed.") - end - - ChatLeaveJob.perform_now(@chat_session_id, @client_id, @session) - end -end diff --git a/app/models/observer/ticket/article/communicate_facebook/background_job.rb b/app/models/observer/ticket/article/communicate_facebook/background_job.rb deleted file mode 100644 index eae2713da..000000000 --- a/app/models/observer/ticket/article/communicate_facebook/background_job.rb +++ /dev/null @@ -1,13 +0,0 @@ -class Observer::Ticket::Article::CommunicateFacebook::BackgroundJob - def initialize(id) - @article_id = id - end - - def perform - if Gem::Version.new(Version.get) >= Gem::Version.new('4.0.x') - ActiveSupport::Deprecation.warn("This file has been migrated to the ActiveJob 'CommunicateFacebookJob' and is therefore deprecated and should get removed.") - end - - CommunicateFacebookJob.perform_now(@article_id) - end -end diff --git a/app/models/observer/ticket/article/communicate_sms/background_job.rb b/app/models/observer/ticket/article/communicate_sms/background_job.rb deleted file mode 100644 index 493cc3f63..000000000 --- a/app/models/observer/ticket/article/communicate_sms/background_job.rb +++ /dev/null @@ -1,13 +0,0 @@ -class Observer::Ticket::Article::CommunicateSms::BackgroundJob - def initialize(id) - @article_id = id - end - - def perform - if Gem::Version.new(Version.get) >= Gem::Version.new('4.0.x') - ActiveSupport::Deprecation.warn("This file has been migrated to the ActiveJob 'CommunicateSmsJob' and is therefore deprecated and should get removed.") - end - - CommunicateSmsJob.perform_now(@article_id) - end -end diff --git a/app/models/observer/ticket/article/communicate_telegram/background_job.rb b/app/models/observer/ticket/article/communicate_telegram/background_job.rb deleted file mode 100644 index 708127d2a..000000000 --- a/app/models/observer/ticket/article/communicate_telegram/background_job.rb +++ /dev/null @@ -1,13 +0,0 @@ -class Observer::Ticket::Article::CommunicateTelegram::BackgroundJob - def initialize(id) - @article_id = id - end - - def perform - if Gem::Version.new(Version.get) >= Gem::Version.new('4.0.x') - ActiveSupport::Deprecation.warn("This file has been migrated to the ActiveJob 'CommunicateTelegramJob' and is therefore deprecated and should get removed.") - end - - CommunicateTelegramJob.perform_now(@article_id) - end -end diff --git a/app/models/observer/ticket/article/communicate_twitter/background_job.rb b/app/models/observer/ticket/article/communicate_twitter/background_job.rb deleted file mode 100644 index 8a8526272..000000000 --- a/app/models/observer/ticket/article/communicate_twitter/background_job.rb +++ /dev/null @@ -1,13 +0,0 @@ -class Observer::Ticket::Article::CommunicateTwitter::BackgroundJob - def initialize(id) - @article_id = id - end - - def perform - if Gem::Version.new(Version.get) >= Gem::Version.new('4.0.x') - ActiveSupport::Deprecation.warn("This file has been migrated to the ActiveJob 'CommunicateTwitterJob' and is therefore deprecated and should get removed.") - end - - CommunicateTwitterJob.perform_now(@article_id) - end -end diff --git a/app/models/transaction/background_job.rb b/app/models/transaction/background_job.rb deleted file mode 100644 index 1fb08c52a..000000000 --- a/app/models/transaction/background_job.rb +++ /dev/null @@ -1,30 +0,0 @@ -class Transaction::BackgroundJob - def initialize(item, params = {}) - -=begin - { - object: 'Ticket', - type: 'update', - ticket_id: 123, - interface_handle: 'application_server', # application_server|websocket|scheduler - changes: { - 'attribute1' => [before,now], - 'attribute2' => [before,now], - }, - created_at: Time.zone.now, - user_id: 123, - }, -=end - - @item = item - @params = params - end - - def perform - if Gem::Version.new(Version.get) >= Gem::Version.new('4.0.x') - ActiveSupport::Deprecation.warn("This file has been migrated to the ActiveJob 'TransactionJob' and is therefore deprecated and should get removed.") - end - - TransactionJob.perform_now(@item, @params) - end -end