Sha256: c6bd806a177035f3403bac4da462a1d2376c7c71a02381c0ef427afc10f0b474
Contents?: true
Size: 557 Bytes
Versions: 45
Compression:
Stored size: 557 Bytes
Contents
# This class should be refactored module Spree class CompareLineItems prepend Spree::ServiceModule::Base def call(order:, line_item:, options: {}, comparison_hooks: nil) comparison_hooks ||= Rails.application.config.spree.line_item_comparison_hooks legacy_part = comparison_hooks.all? do |hook| order.send(hook, line_item, options) end success(legacy_part && compare(line_item, options)) end private # write your custom logic here def compare(_line_item, _options) true end end end
Version data entries
45 entries across 45 versions & 1 rubygems