diff --git a/app/models/web_hook.rb b/app/models/web_hook.rb index 06bae70363a..b1492d96f47 100644 --- a/app/models/web_hook.rb +++ b/app/models/web_hook.rb @@ -40,8 +40,6 @@ class WebHook < ActiveRecord::Base WebHookEventType::TYPES[:post_edited], WebHookEventType::TYPES[:post_destroyed], WebHookEventType::TYPES[:post_recovered], - WebHookEventType::TYPES[:category_experts_approved], - WebHookEventType::TYPES[:category_experts_unapproved], ], ) end diff --git a/app/models/web_hook_event_type.rb b/app/models/web_hook_event_type.rb index 5f4c57fc676..f4120e7cab9 100644 --- a/app/models/web_hook_event_type.rb +++ b/app/models/web_hook_event_type.rb @@ -85,8 +85,6 @@ class WebHookEventType < ActiveRecord::Base chat_message_edited: 1802, chat_message_trashed: 1803, chat_message_restored: 1804, - category_experts_approved: 1901, - category_experts_unapproved: 1902, } has_and_belongs_to_many :web_hooks @@ -118,11 +116,6 @@ class WebHookEventType < ActiveRecord::Base ], ) end - unless defined?(SiteSetting.enable_category_experts) && SiteSetting.enable_category_experts - ids_to_exclude.concat( - [TYPES[:category_experts_approved], TYPES[:category_experts_unapproved]], - ) - end self.where.not(id: ids_to_exclude) end end diff --git a/config/locales/client.en.yml b/config/locales/client.en.yml index 8849870871e..50fbe9ae30e 100644 --- a/config/locales/client.en.yml +++ b/config/locales/client.en.yml @@ -5442,8 +5442,6 @@ en: post_edited: "Post is updated" post_destroyed: "Post is deleted" post_recovered: "Post is recovered" - category_experts_approved: "Post marked as category experts post" - category_experts_unapproved: "Post unmarked as category experts post" group_event: group_name: "Group Events" group_created: "Group is created" diff --git a/db/fixtures/007_web_hook_event_types.rb b/db/fixtures/007_web_hook_event_types.rb index 6f619eaee93..e5da6fbb957 100644 --- a/db/fixtures/007_web_hook_event_types.rb +++ b/db/fixtures/007_web_hook_event_types.rb @@ -230,13 +230,3 @@ WebHookEventType.seed do |b| b.name = "chat_message_restored" b.group = WebHookEventType.groups[:chat] end -WebHookEventType.seed do |b| - b.id = WebHookEventType::TYPES[:category_experts_approved] - b.name = "category_experts_approved" - b.group = WebHookEventType.groups[:post] -end -WebHookEventType.seed do |b| - b.id = WebHookEventType::TYPES[:category_experts_unapproved] - b.name = "category_experts_unapproved" - b.group = WebHookEventType.groups[:post] -end diff --git a/db/migrate/20241024093027_remove_category_experts_web_hook_event_types.rb b/db/migrate/20241024093027_remove_category_experts_web_hook_event_types.rb new file mode 100644 index 00000000000..a4fd0f56401 --- /dev/null +++ b/db/migrate/20241024093027_remove_category_experts_web_hook_event_types.rb @@ -0,0 +1,10 @@ +# frozen_string_literal: true +class RemoveCategoryExpertsWebHookEventTypes < ActiveRecord::Migration[7.1] + def up + execute "DELETE FROM web_hook_event_types WHERE (name, id) IN (('category_experts_approved', 1901), ('category_experts_unapproved', 1902))" + end + + def down + raise ActiveRecord::IrreversibleMigration + end +end diff --git a/spec/models/web_hook_event_type_spec.rb b/spec/models/web_hook_event_type_spec.rb index 32821cec352..471f67bd449 100644 --- a/spec/models/web_hook_event_type_spec.rb +++ b/spec/models/web_hook_event_type_spec.rb @@ -49,7 +49,6 @@ RSpec.describe WebHookEventType do SiteSetting.stubs(:assign_enabled).returns(true) SiteSetting.stubs(:topic_voting_enabled).returns(true) SiteSetting.stubs(:chat_enabled).returns(true) - SiteSetting.stubs(:enable_category_experts).returns(true) plugins_event_types = WebHookEventType.active.map(&:name) - core_event_types expect(plugins_event_types).to match_array( %w[ @@ -63,8 +62,6 @@ RSpec.describe WebHookEventType do chat_message_edited chat_message_trashed chat_message_restored - category_experts_approved - category_experts_unapproved ], ) end