Sha256: 35e766f3af11dc0861ca0bb42feefac7ec7e914982f76157526c19b0bf761c11
Contents?: true
Size: 680 Bytes
Versions: 8
Compression:
Stored size: 680 Bytes
Contents
require 'omnes' module Spree # Global [Omnes](https://github.com/nebulab/omnes) bus. # # This is used for internal events, while host applications are also able to # use it. # # It has some modifications to support internal usage of the legacy event # system {see Spree::AppConfiguration#use_legacy_events}. Bus = Omnes::Bus.new Bus.define_singleton_method(:publish) do |*args, **kwargs, &block| if Spree::Config.use_legacy_events Spree::Event.fire(*args, **kwargs, &block) else # Override caller_location to point to the actual event publisher super(*args, **kwargs, caller_location: caller_locations(1)[0], &block) end end end
Version data entries
8 entries across 8 versions & 1 rubygems