Skip to content

Commit

Permalink
Merge pull request #53 from nebulab/spaghetticode/new-event-subscribe…
Browse files Browse the repository at this point in the history
…rs-mappings

Use `Spree::Event. activate_all_subscribers` when available
  • Loading branch information
kennyadsl committed Oct 26, 2020
2 parents 1011d52 + 5b52ea7 commit 371c942
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion lib/solidus_support/engine_extensions.rb
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,12 @@ def load_solidus_subscribers_from(path)
path.glob("**/*_subscriber.rb") do |subscriber_path|
require_dependency(subscriber_path)
end
Spree::Event.subscribers.each(&:subscribe!)

if Spree::Event.respond_to?(:activate_all_subscribers)
Spree::Event.activate_all_subscribers
else
Spree::Event.subscribers.each(&:subscribe!)
end
end
end

Expand Down

0 comments on commit 371c942

Please sign in to comment.