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

module Spree
  module PromotionHandler
    # Used for activating promotions with shipping rules
    class Shipping
      attr_reader :order
      attr_accessor :error, :succes
    
      def activate
        connected_promotions.each do |order_promotion|
          if order_promotion.promotion.eligible?(order)
            order_promotion.promotion.activate(
              order: order,
              promotion_code: order_promotion.promotion_code,
            )
          end
        end