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: type.rb
    path of file: ./repos/openproject/app/models
    
    the code of the file until where you have to start completion: #-- copyright
# OpenProject is an open 
    
  def to_s; name end

  def <=>(other)
    name <=> other.name
  end

  def self.statuses(types)
    workflow_table, status_table = [Workflow, Status].map(&:arel_table)
    old_id_subselect, new_id_subselect = %i[old_status_id new_status_id].map do |foreign_key|
      workflow_table.project(workflow_table[foreign_key]).where(workflow_table[:type_id].in(types))
    end
    Status.where(status_table[:id].in(old_id_subselect).or(status_table[:id].in(new_id_subselect)))
  end

  def self.standard_type
    ::Type.where(is_standard: true).first
  end

  def self.default
    ::Type.where(is_default: true)
  end

  def self.enabled_in(project)
    ::Type.includes(:projects).where(projects: { id: project })
  end

  def statuses(include_default: false)
    if new_record?
      Status.none
    elsif include_default
      ::Type
        .statuses([id])
        .or(Status.where_default)
    else
      ::Type.statuses([id])
    end
  end