summaryrefslogtreecommitdiff
path: root/lib/solidus_subscriptions/engine.rb
diff options
context:
space:
mode:
authorBrendan Deere <brendan@stembolt.com>2016-09-28 13:56:21 -0700
committerBrendan Deere <brendan@stembolt.com>2016-09-28 14:31:28 -0700
commit41885d548ad9870fd2272543c09241f81cc92d2b (patch)
tree00886dc57ba70a1fb24852cd5d8fa970031b85aa /lib/solidus_subscriptions/engine.rb
parent7414d6856d4f746ca7000985860e415385edef31 (diff)
Register Subscription promotion rule with solidus
Add the custom promotion rule to the list of solidus promotion rules. add some translations and an empty template so that the admin can render the promotion rule properly
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 50b1dc1..78f0d47 100644
--- a/lib/solidus_subscriptions/engine.rb
+++ b/lib/solidus_subscriptions/engine.rb
@@ -15,6 +15,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)