mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-24 20:36:49 +00:00
Persist last_ip_address when loading current_order
Leaving the object with unpersisted changes breaks order locking with this error (in various places):
RuntimeError:
Locking a record with unpersisted changes is not supported. Use `save` to persist the changes, or `reload` to discard them explicitly.
This commit is contained in:
@@ -52,7 +52,7 @@ module Spree
|
||||
|
||||
return unless @current_order
|
||||
|
||||
@current_order.last_ip_address = ip_address
|
||||
@current_order.update_columns(last_ip_address: ip_address)
|
||||
session[:order_id] = @current_order.id
|
||||
@current_order
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user