spree-contrib / spree_digital

A Spree extension to enable downloadable products
http://spreecommerce.org
MIT License
117 stars 97 forks source link

Make spree_frontend dependency optional? #126

Open fauno opened 4 years ago

fauno commented 4 years ago

I applied this patch locally and it seems to work fine, is there a reason to depend on frontend?

diff --git a/app/controllers/spree/digitals_controller.rb b/app/controllers/spree/digitals_controller.rb
index f3ba81d..ede2d58 100644
--- a/app/controllers/spree/digitals_controller.rb
+++ b/app/controllers/spree/digitals_controller.rb
@@ -1,5 +1,5 @@
 module Spree
-  class DigitalsController < Spree::StoreController
+  class DigitalsController < Spree::BaseController
     def show
       if attachment.present?
         if digital_link.authorize!
diff --git a/lib/spree_digital.rb b/lib/spree_digital.rb
index 4fe7641..7c850c2 100644
--- a/lib/spree_digital.rb
+++ b/lib/spree_digital.rb
@@ -1,7 +1,6 @@
 require 'spree_api'
 require 'spree_backend'
 require 'spree_core'
-require 'spree_frontend'
 require 'spree_digital/engine'
 require 'sass/rails'
 require 'spree_extension'
diff --git a/spree_digital.gemspec b/spree_digital.gemspec
index d0db59f..51c2161 100644
--- a/spree_digital.gemspec
+++ b/spree_digital.gemspec
@@ -17,7 +17,6 @@ Gem::Specification.new do |s|
   s.add_dependency 'spree_api', spree_version
   s.add_dependency 'spree_backend', spree_version
   s.add_dependency 'spree_core', spree_version
-  s.add_dependency 'spree_frontend', spree_version
   s.add_runtime_dependency 'spree_extension'
   s.add_dependency 'deface', '~> 1.0'