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: topic_view_serializer.rb
    path of file: ./repos/discourse/app/serializers
    
    the code of the file until where you have to start completion: # frozen_string_literal: true

class TopicViewSerializer < ApplicationSerializer
  include PostStreamSeria
    
  def topic_timer
    topic_timer = object.topic.public_topic_timer

    return nil if topic_timer.blank?

    if topic_timer.publishing_to_category?
      return nil if !scope.can_see_category?(Category.find_by(id: topic_timer.category_id))
    end