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: nth_order.rb
    path of file: ./repos/solidus/core/app/models/spree/promotion/rules
    
    the code of the file until where you have to start completion: # frozen_string_literal: true

module Spree
  class Promotion
    module Rules
      class NthOr
    
        def completed_order_count(order)
          order.
            user.
            orders.
            complete.
            where(Spree::Order.arel_table[:completed_at].lt(order.completed_at || Time.current)).
            count
        end