diff options
author | Alessandro Desantis <desa.alessandro@gmail.com> | 2021-02-05 13:30:47 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-02-05 13:30:47 +0100 |
commit | 3a3657b79bd5d98025136da4b39751e6a43b7b9f (patch) | |
tree | b7a57b183641d64d05e5e70e281fd78cb5e37ebd /app/services/solidus_subscriptions/subscription_line_item_builder.rb | |
parent | 69f0ca038b66d0ca36971405e51c0d3aa916cf19 (diff) | |
parent | 4717d24c0e7203210efe8c23b55467c3e728cdc5 (diff) |
Merge pull request #172 from solidusio-contrib/aldesantis/refactoring
Processor and Checkout refactoring
Diffstat (limited to 'app/services/solidus_subscriptions/subscription_line_item_builder.rb')
-rw-r--r-- | app/services/solidus_subscriptions/subscription_line_item_builder.rb | 23 |
1 files changed, 0 insertions, 23 deletions
diff --git a/app/services/solidus_subscriptions/subscription_line_item_builder.rb b/app/services/solidus_subscriptions/subscription_line_item_builder.rb deleted file mode 100644 index 7354102..0000000 --- a/app/services/solidus_subscriptions/subscription_line_item_builder.rb +++ /dev/null @@ -1,23 +0,0 @@ -# frozen_string_literal: true - -module SolidusSubscriptions - module SubscriptionLineItemBuilder - private - - def create_subscription_line_item(line_item) - SolidusSubscriptions::LineItem.create!( - subscription_params.merge(spree_line_item: line_item) - ) - - # Rerun the promotion handler to pickup subscription promotions - ::Spree::PromotionHandler::Cart.new(line_item.order).activate - line_item.order.recalculate - end - - def subscription_params - params.require(:subscription_line_item).permit( - SolidusSubscriptions.configuration.subscription_line_item_attributes - ) - end - end -end |