DEV: Use a single registry for preloaded category custom fields (#24272)

There was a registry for preloaded site categories and a new one has
been introduced recently for categories serialized through a
CategoryList.

Having two registries created a lot of friction for developers and this
commit merges them into a single one, providing a unified API.
This commit is contained in:
Bianca Nenciu
2023-11-09 18:23:24 +02:00
committed by GitHub
parent e772bb9fce
commit bdb81b5346
3 changed files with 7 additions and 10 deletions

View File

@ -292,9 +292,9 @@ class Plugin::Instance
# Registers a category custom field to be loaded when rendering a category list
# Example usage:
# register_category_list_preloaded_category_custom_fields("custom_field")
def register_category_list_preloaded_category_custom_fields(field)
CategoryList.preloaded_category_custom_fields << field
# register_preloaded_category_custom_fields("custom_field")
def register_preloaded_category_custom_fields(field)
Site.preloaded_category_custom_fields << field
end
def custom_avatar_column(column)