Sha256: 9e0780f85c4c0fb2653d9e2edba1b2dc0f2fece5ebd0292917b44d2dcb7dfb1e

Contents?: true

Size: 389 Bytes

Versions: 97

Compression:

Stored size: 389 Bytes

Contents

module Spree
  module LineItems
    class FindByVariant
      def execute(order:, variant:, options: {})
        order.line_items.detect do |line_item|
          next unless line_item.variant_id == variant.id

          Spree::Dependencies.cart_compare_line_items_service.constantize.call(order: order, line_item: line_item, options: options).value
        end
      end
    end
  end
end

Version data entries

97 entries across 97 versions & 1 rubygems

Version Path
spree_core-4.8.3 app/finders/spree/line_items/find_by_variant.rb
spree_core-4.8.2 app/finders/spree/line_items/find_by_variant.rb
spree_core-4.7.3 app/finders/spree/line_items/find_by_variant.rb
spree_core-4.6.6 app/finders/spree/line_items/find_by_variant.rb
spree_core-4.5.5 app/finders/spree/line_items/find_by_variant.rb
spree_core-4.0.9 app/finders/spree/line_items/find_by_variant.rb
spree_core-4.1.15 app/finders/spree/line_items/find_by_variant.rb
spree_core-4.2.7 app/finders/spree/line_items/find_by_variant.rb
spree_core-4.3.3 app/finders/spree/line_items/find_by_variant.rb
spree_core-4.4.1 app/finders/spree/line_items/find_by_variant.rb
spree_core-4.5.4 app/finders/spree/line_items/find_by_variant.rb
spree_core-4.6.5 app/finders/spree/line_items/find_by_variant.rb
spree_core-4.7.2 app/finders/spree/line_items/find_by_variant.rb
spree_core-4.7.1 app/finders/spree/line_items/find_by_variant.rb
spree_core-4.6.4 app/finders/spree/line_items/find_by_variant.rb
spree_core-4.7.0 app/finders/spree/line_items/find_by_variant.rb
spree_core-4.6.3 app/finders/spree/line_items/find_by_variant.rb
spree_core-4.6.2 app/finders/spree/line_items/find_by_variant.rb
spree_core-4.6.1 app/finders/spree/line_items/find_by_variant.rb
spree_core-4.6.0 app/finders/spree/line_items/find_by_variant.rb