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: linear.rb
    path of file: ./repos/gitlabhq/app/models/namespaces/traversal
    
    the code of the file until where you have to start completion: # frozen_string_literal: true
#
# Query a recursively defined namespace hierarchy using linear methods through
# t
    
      def set_traversal_ids
        return if id.blank?

        # This is a temporary guard and will be removed.
        return if is_a?(Namespaces::ProjectNamespace)

        self.transient_traversal_ids = if parent_id
                                         parent.traversal_ids + [id]
                                       else
                                         [id]
                                       end