Module: SolidusSupport::LegacyEventCompat

Defined in:
lib/solidus_support/legacy_event_compat.rb,
lib/solidus_support/legacy_event_compat/bus.rb,
lib/solidus_support/legacy_event_compat/subscriber.rb

Overview

Compatibility middleman for Spree::Event and Spree::Bus

Solidus v3.2 changed to use [Omnes](github.com/nebulab/omnes) as the backbone for event-driven behavior (see Spree::Bus) by default. Before that, a custom adapter based on ActiveSupport::Notifications was used (see Spree::Event. Both systems are still supported on v3.2.

This module provides compatibility support so that extensions can easily target both systems regardless of the underlying circumstances:

  • Solidus v3.2 with the new system.

  • Solidus v3.2 with the legacy system.

  • Solidus v2.9 to v3.1, when only Spree::Event existed.

  • Possible future versions of Solidus, whether the legacy system is

eventually removed or not.

Defined Under Namespace

Modules: Bus, Subscriber

Class Method Summary collapse

Class Method Details

.using_legacy?Boolean

Returns whether the application is using the legacy event system

Returns:

  • (Boolean)


26
27
28
29
30
# File 'lib/solidus_support/legacy_event_compat.rb', line 26

def self.using_legacy?
  legacy_present? &&
    (legacy_alone? ||
     legacy_chosen?)
end