mirror of
https://github.com/discourse/discourse.git
synced 2025-05-30 05:30:06 +08:00
DEV: Improvements to plugin API docs (#31988)
Follow-up to af03873d37decf8dba4278fc38bfcde7747a79f4
This commit is contained in:

committed by
GitHub

parent
9d786ad870
commit
f1a67ecb37
@ -1442,10 +1442,17 @@ class Plugin::Instance
|
||||
DiscoursePluginRegistry.register_topic_preloader_association(fields, self)
|
||||
end
|
||||
|
||||
# When loading /categories with topics, preload topic associations
|
||||
# using register_category_list_topics_preloader_associations(:association_name)
|
||||
def register_category_list_topics_preloader_associations(fields)
|
||||
DiscoursePluginRegistry.register_category_list_topics_preloader_association(fields, self)
|
||||
##
|
||||
# Allows plugins to preload topic associations when loading categories with topics.
|
||||
#
|
||||
# @param fields [Array<Symbol>] The topic associations to preload.
|
||||
#
|
||||
# @example Preload custom topic associations
|
||||
#
|
||||
# register_category_list_topics_preloader_associations(%i[some_topic_association some_other_topic_association])
|
||||
#
|
||||
def register_category_list_topics_preloader_associations(associations)
|
||||
DiscoursePluginRegistry.register_category_list_topics_preloader_association(associations, self)
|
||||
end
|
||||
|
||||
private
|
||||
|
Reference in New Issue
Block a user