Class: Spree::Cart::RemoveLineItem
- Inherits:
-
Object
- Object
- Spree::Cart::RemoveLineItem
- Includes:
- ServiceModule::Base
- Defined in:
- app/services/spree/cart/remove_line_item.rb
Instance Method Summary collapse
Methods included from ServiceModule::Base
Instance Method Details
#call(order:, line_item:, options: nil) ⇒ Object
6 7 8 9 10 11 12 13 14 15 16 |
# File 'app/services/spree/cart/remove_line_item.rb', line 6 def call(order:, line_item:, options: nil) ||= {} ActiveRecord::Base.transaction do line_item.destroy! Spree::Dependencies.cart_recalculate_service.constantize.new.call(order: order, line_item: line_item, options: ) end order.reload success(line_item) end |