Skip to content
This repository was archived by the owner on Jul 14, 2025. It is now read-only.

Commit c234819

Browse files
authored
DEV: Use new API to preload category custom fields (#521)
1 parent 5055bcb commit c234819

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

plugin.rb

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,12 @@ module ::DiscourseAssign
171171

172172
on(:unassign_topic) { |topic, unassigning_user| Assigner.new(topic, unassigning_user).unassign }
173173

174-
Site.preloaded_category_custom_fields << "enable_unassigned_filter"
174+
if respond_to?(:register_preloaded_category_custom_fields)
175+
register_preloaded_category_custom_fields("enable_unassigned_filter")
176+
else
177+
# TODO: Drop the if-statement and this if-branch in Discourse v3.2
178+
Site.preloaded_category_custom_fields << "enable_unassigned_filter"
179+
end
175180

176181
BookmarkQuery.on_preload do |bookmarks, bookmark_query|
177182
if SiteSetting.assign_enabled?

0 commit comments

Comments
 (0)