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:
parent
59d2b8c990
commit
fd97d23208
@ -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
|
||||
|
||||
|
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user