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: preload_scopes_builder.rb
    path of file: ./repos/foreman/app/services/foreman
    
    the code of the file until where you have to start completion: module Foreman
  class PreloadScopesBuilder
    attr_reader :original_model

    def initialize(original_model)
      @original_model = original_model
    end

    def scopes
      @scopes ||= begin
        (preload_scopes + Foreman::Plugin.all.map { |plugin| plugin.preload_scopes[original_model.to_s] }).flatten.compact.uniq
      end
    end

    private

    # Must return an Array
    # Can be defined on an ActiveRecord model's class to add custom scopes which can't be created automatically
    def preload_scopes
      original_model_scopes = 
    
    def build_scopes(model, ignore: [], assoc_name: nil)
      scopes = dependent_associations(model).map do |assoc|
        next if ignore.include?(assoc.name)

        dep_associations = dependent_associations(assoc.klass)
        if dep_associations.any?
          ignore += dep_associations.select { |to_ignore| to_ignore.options.key?(:through) }.map(&:name)
          ignore << assoc.name
          dep_scopes = build_scopes(assoc.klass, ignore: ignore, assoc_name: assoc.name)
          if assoc.options.key?(:through) && dep_scopes.is_a?(Hash)
            next { assoc.options[:through] => assoc.source_reflection_name }.merge(dep_scopes)
          end
          next dep_scopes
        end