1
0
mirror of https://github.com/LaCasemate/fab-manager.git synced 2025-01-18 07:52:23 +01:00

(feat) set order reference after create order

This commit is contained in:
Du Peng 2022-09-06 19:16:29 +02:00
parent 59d2b8c990
commit fd97d23208
2 changed files with 1 additions and 1 deletions

View File

@ -17,6 +17,7 @@ class Order < PaymentDocument
validates :token, :state, presence: true
before_create :add_environment
after_create :update_reference
delegate :user, to: :statistic_profile

View File

@ -35,7 +35,6 @@ module Payments::PaymentConcern
order.order_items.each do |item|
ProductService.update_stock(item.orderable, 'external', 'sold', -item.quantity, item.id)
end
order.reference = order.generate_reference
order.save
order.reload
end