You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: category_list.rb
    path of file: ./repos/discourse/app/models
    
    the code of the file until where you have to start completion: # frozen_string_literal: true

class CategoryList
  CATEGORIES_PER_PAGE = 20
  SUBCATEGORIES_PER_CATEGORY = 5

  include ActiveModel::Serialization

  cattr_accessor :preloaded_topic_custom_fields
  self.preloaded_topic_custom_fields = Set.new

  attr_accessor :categories, :uncategorized

  def self.register_included_association(association)
    @included_assocations ||= []
    @included_assocations << association if !@included_assocations.include?(association)
  end

  def self.included_associations
    [
      :uploaded_background,
      :uploaded_background_dark,
      :uploaded_logo,
      :uploaded_logo_dark,
      :topic_only_relative_url,
      subcategories: [:topic_o
    
  def find_relevant_topics
    @all_topics =
      Topic
        .secured(@guardian)
        .joins(
          "INNER JOIN category_featured_topics ON topics.id = category_featured_topics.topic_id",
        )
        .where("category_featured_topics.category_id IN (?)", categories_with_descendants.map(&:id))
        .select(
          "topics.*, category_featured_topics.category_id AS category_featured_topic_category_id",
        )
        .includes(:shared_draft, :category, { topic_thumbnails: %i[optimized_image upload] })
        .order("category_featured_topics.rank")

    @all_topics = @all_topics.joins(:tags).where(tags: { name: @options[:tag] }) if @options[
      :tag
    ].present?

    if @guardian.authenticated?
      @all_topics =
        @all_topics
          .joins(
            "LEFT JOIN topic_users tu ON topics.id = tu.topic_id AND tu.user_id = #{@guardian.user.id.to_i}",
          )
          .joins(
            "LEFT JOIN category_users ON category_users.category_id = topics.category_id AND category_users.user_id = #{@guardian.user.id}",
          )
          .where(
            "COALESCE(tu.notification_level,1) > :muted",
            muted: TopicUser.notification_levels[:muted],
          )
    end