From 67abf8e6bda0b29eaa891c4f0e09c7ea811ce668 Mon Sep 17 00:00:00 2001 From: Alessandro Desantis Date: Sun, 27 Sep 2020 11:01:11 +0200 Subject: Implement a `LineItem#subscribable` association --- lib/solidus_subscriptions/configuration.rb | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'lib/solidus_subscriptions/configuration.rb') diff --git a/lib/solidus_subscriptions/configuration.rb b/lib/solidus_subscriptions/configuration.rb index 3ab5f82..d5dc80f 100644 --- a/lib/solidus_subscriptions/configuration.rb +++ b/lib/solidus_subscriptions/configuration.rb @@ -8,7 +8,7 @@ module SolidusSubscriptions :success_dispatcher_class, :failure_dispatcher_class, :payment_failed_dispatcher_class, :out_of_stock_dispatcher, :maximum_successive_skips, :reprocessing_interval, :minimum_cancellation_notice, :processing_queue, :subscription_line_item_attributes, - :subscription_attributes, + :subscription_attributes, :subscribable_class, ) def success_dispatcher_class @@ -68,5 +68,10 @@ module SolidusSubscriptions }, ] end + + def subscribable_class + @subscribable_class ||= 'Spree::Variant' + @subscribable_class.constantize + end end end -- cgit v1.2.3