summaryrefslogtreecommitdiff
path: root/lib/solidus_subscriptions/engine.rb
diff options
context:
space:
mode:
authorBrendan Deere <brendangdeere@gmail.com>2016-09-28 15:29:23 -0700
committerGitHub <noreply@github.com>2016-09-28 15:29:23 -0700
commit7b338cc7384a768464c3299c753b0659041f771f (patch)
tree273b1a21839765a2a78115b0a0455f07a3acb276 /lib/solidus_subscriptions/engine.rb
parente61cb28e49471f5a70dc206c429972ac5713fa11 (diff)
parent41885d548ad9870fd2272543c09241f81cc92d2b (diff)
Merge pull request #67 from brendandeere/promo_rule
Promo rule
Diffstat (limited to 'lib/solidus_subscriptions/engine.rb')
-rw-r--r--lib/solidus_subscriptions/engine.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/solidus_subscriptions/engine.rb b/lib/solidus_subscriptions/engine.rb
index 6b6f8d3..368a6a0 100644
--- a/lib/solidus_subscriptions/engine.rb
+++ b/lib/solidus_subscriptions/engine.rb
@@ -18,6 +18,10 @@ module SolidusSubscriptions
require 'solidus_subscriptions/config'
end
+ initializer 'register_subscription_promotion_rule', after: 'spree.promo.register.promotion.rules' do |app|
+ app.config.spree.promotions.rules << 'SolidusSubscriptions::SubscriptionPromotionRule'
+ end
+
def self.activate
Dir.glob(File.join(File.dirname(__FILE__), '../../app/decorators/**/*.rb')) do |c|
Rails.configuration.cache_classes ? require(c) : load(c)