Sha256: 4920220a97dcb331a23975dcf1ff143cc4b867d2fe6c463a39788f912a92e370

Contents?: true

Size: 381 Bytes

Versions: 22

Compression:

Stored size: 381 Bytes

Contents

module Spree
  module Variants
    class RemoveLineItems
      prepend Spree::ServiceModule::Base

      def call(variant:)
        variant.line_items.joins(:order).where.not(spree_orders: { state: 'complete' }).find_each do |line_item|
          Spree::Variants::RemoveLineItemJob.perform_later(line_item: line_item)
        end

        success(true)
      end
    end
  end
end

Version data entries

22 entries across 22 versions & 1 rubygems

Version Path
spree_core-4.10.1 app/services/spree/variants/remove_line_items.rb
spree_core-4.10.0 app/services/spree/variants/remove_line_items.rb
spree_core-4.9.0 app/services/spree/variants/remove_line_items.rb
spree_core-4.8.3 app/services/spree/variants/remove_line_items.rb
spree_core-4.8.2 app/services/spree/variants/remove_line_items.rb
spree_core-4.7.3 app/services/spree/variants/remove_line_items.rb
spree_core-4.6.6 app/services/spree/variants/remove_line_items.rb
spree_core-4.5.5 app/services/spree/variants/remove_line_items.rb
spree_core-4.5.4 app/services/spree/variants/remove_line_items.rb
spree_core-4.6.5 app/services/spree/variants/remove_line_items.rb
spree_core-4.7.2 app/services/spree/variants/remove_line_items.rb
spree_core-4.7.1 app/services/spree/variants/remove_line_items.rb
spree_core-4.6.4 app/services/spree/variants/remove_line_items.rb
spree_core-4.7.0 app/services/spree/variants/remove_line_items.rb
spree_core-4.6.3 app/services/spree/variants/remove_line_items.rb
spree_core-4.6.2 app/services/spree/variants/remove_line_items.rb
spree_core-4.6.1 app/services/spree/variants/remove_line_items.rb
spree_core-4.6.0 app/services/spree/variants/remove_line_items.rb
spree_core-4.5.3 app/services/spree/variants/remove_line_items.rb
spree_core-4.5.2 app/services/spree/variants/remove_line_items.rb