Skip to content

Commit

Permalink
Add CategoryList preloading to custom fields
Browse files Browse the repository at this point in the history
  • Loading branch information
angusmcleod committed Nov 6, 2023
1 parent 077e99d commit 5e60b42
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion plugin.rb
@@ -1,7 +1,7 @@
# frozen_string_literal: true
# name: discourse-events
# about: Allows you to manage events in Discourse
# version: 0.2.9
# version: 0.2.10
# authors: Angus McLeod
# contact_emails: development@pavilion.tech
# url: https://github.com/paviliondev/discourse-events
Expand Down Expand Up @@ -115,6 +115,7 @@
"events_min_trust_to_create",
"events_required"
].each do |key|
CategoryList.preloaded_category_custom_fields << key if CategoryList.respond_to? :preloaded_category_custom_fields
Site.preloaded_category_custom_fields << key if Site.respond_to? :preloaded_category_custom_fields
add_to_class(:category, key.to_sym) { self.custom_fields[key] }
add_to_serializer(:basic_category, key.to_sym) { object.send(key) }
Expand Down

0 comments on commit 5e60b42

Please sign in to comment.