Sha256: 79c69d68a7bdd606ccbd1fd7bf360763b972e048b7a795d97f37691c04ebb347
Contents?: true
Size: 496 Bytes
Versions: 26
Compression:
Stored size: 496 Bytes
Contents
module Spree module LineItems class Create prepend Spree::ServiceModule::Base include Helper def call(order:, line_item_attributes: {}, options: {}) line_item = order.line_items.new(line_item_attributes) ActiveRecord::Base.transaction do return failure(line_item) unless line_item.save recalculate_service.call(order: order, line_item: line_item, options: options) end success(line_item) end end end end
Version data entries
26 entries across 26 versions & 1 rubygems