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

module Preloaders
  # This class preloads the max access level (role) for the user within the g
    
    def initialize(projects, user)
      @projects = if projects.is_a?(Array)
                    Project.where(id: projects)
                  else
                    # Push projects base query in to a sub-select to avoid
                    # table name clashes. Performs better than aliasing.
                    Project.where(id: projects.subquery(:id))
                  end