Sha256: c4f88a06797ab07406e1a6e8f48205e9788d670f8e6466bf22ebfda30e1f8acd
Contents?: true
Size: 707 Bytes
Versions: 8
Compression:
Stored size: 707 Bytes
Contents
module Returnly module Builders class CustomerReturn class << self def build_by_return_items(return_items) Spree::CustomerReturn.create( return_items: return_items, stock_location_id: stock_location_id(return_items.first) ) end def build_by_stock_location(stock_location) Spree::CustomerReturn.new(stock_location: stock_location) end private def stock_location_id(return_item) return_item_order(return_item).shipments.last.stock_location_id end def return_item_order(return_item) return_item.inventory_unit.order end end end end end
Version data entries
8 entries across 8 versions & 2 rubygems