Sha256: 26f0449e7cb2761998c4acef4c6dc6f513b56334b121e557cf843daadac6c005

Contents?: true

Size: 526 Bytes

Versions: 57

Compression:

Stored size: 526 Bytes

Contents

# This class should be refactored
module Spree
  class CompareLineItems
    prepend Spree::ServiceModule:: Base

    def call(order:, line_item:, options: {}, 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

57 entries across 57 versions & 1 rubygems

Version Path
spree_core-4.0.9 app/services/spree/compare_line_items.rb
spree_core-4.1.15 app/services/spree/compare_line_items.rb
spree_core-4.1.14 app/services/spree/compare_line_items.rb
spree_core-4.0.8 app/services/spree/compare_line_items.rb
spree_core-3.7.14.1 app/services/spree/compare_line_items.rb
spree_core-4.1.13.1 app/services/spree/compare_line_items.rb
spree_core-4.0.7.1 app/services/spree/compare_line_items.rb
spree_core-4.0.7 app/services/spree/compare_line_items.rb
spree_core-3.7.14 app/services/spree/compare_line_items.rb
spree_core-4.1.13 app/services/spree/compare_line_items.rb
spree_core-4.0.6 app/services/spree/compare_line_items.rb
spree_core-4.2.0.rc2 app/services/spree/compare_line_items.rb
spree_core-3.7.13 app/services/spree/compare_line_items.rb
spree_core-4.0.5 app/services/spree/compare_line_items.rb
spree_core-4.1.12 app/services/spree/compare_line_items.rb
spree_core-3.7.12 app/services/spree/compare_line_items.rb
spree_core-4.2.0.rc1 app/services/spree/compare_line_items.rb
spree_core-4.0.4 app/services/spree/compare_line_items.rb
spree_core-3.7.11 app/services/spree/compare_line_items.rb
spree_core-4.1.11 app/services/spree/compare_line_items.rb