DEV: Ensure topic_list custom field preloading persists in development (#324)

This was causing an error on topic lists after a zeitwerk reload. Using the official plugin API takes care of reloading correctly.
This commit is contained in:
David Taylor 2022-09-22 10:27:48 +01:00 committed by GitHub
parent a7ca28e5fc
commit 139fdd9cc3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -251,7 +251,7 @@ after_initialize do
end
end
TopicList.preloaded_custom_fields << DiscoursePostEvent::TOPIC_POST_EVENT_STARTS_AT
add_preloaded_topic_list_custom_field DiscoursePostEvent::TOPIC_POST_EVENT_STARTS_AT
add_to_serializer(:topic_view, :event_starts_at, false) do
object.topic.custom_fields[DiscoursePostEvent::TOPIC_POST_EVENT_STARTS_AT]