diff options
author | Brendan Deere <brendan@stembolt.com> | 2016-10-04 13:55:18 -0700 |
---|---|---|
committer | Brendan Deere <brendan@stembolt.com> | 2016-10-07 11:40:50 -0700 |
commit | a6fac85f3f85dfa66e67a65e0d03cb330bef1566 (patch) | |
tree | bc49779a52be15fcc38214ba66b97f5c550e2fb8 /lib/solidus_subscriptions | |
parent | 7b87a666bf9542df95a82c076c1fa1fe07230a52 (diff) |
Add a link to the subscriptions backend area
Jam this link into the admin sidebar
Diffstat (limited to 'lib/solidus_subscriptions')
-rw-r--r-- | lib/solidus_subscriptions/engine.rb | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/lib/solidus_subscriptions/engine.rb b/lib/solidus_subscriptions/engine.rb index 69311d0..baf4d9f 100644 --- a/lib/solidus_subscriptions/engine.rb +++ b/lib/solidus_subscriptions/engine.rb @@ -22,6 +22,17 @@ module SolidusSubscriptions app.config.spree.promotions.rules << 'SolidusSubscriptions::SubscriptionOrderPromotionRule' end + initializer 'subscriptions_backend' do + next unless Spree::Backend::Config.respond_to?(:menu_items) + Spree::Backend::Config.configure do |config| + config.menu_items << config.class::MenuItem.new( + [:subscriptions], + 'repeat', + url: :admin_subscriptions_path + ) + end + end + def self.activate Dir.glob(File.join(File.dirname(__FILE__), '../../app/decorators/**/*.rb')) do |c| Rails.configuration.cache_classes ? require(c) : load(c) |