You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Line 11 of checkout_controller_decorator.rb calls update_attribute on an order to set the order's email address, but this saves the order without running validations. This saves blank addresses (all fields nil) into the database, which can conflict with validations performed by other gems.
If possible, we would like to suggest using an alternate means of setting the email address on a guest order that does not cause the order object to be saved without validations, such as simple attribute assignment (order.email = ...).
mike-bourgeous
changed the title
Calling update_attribute on an order prematurely saves it with invalid/blank addresses
Calling update_attribute on an order saves it prematurely with invalid/blank addresses
Sep 29, 2015
Hi @mike-bourgeous, I have faced this same issue in Spree 3.7 with latest Spree Auth Devise. I have solved this issue by calling reload on current_order like this :
Line 11 of checkout_controller_decorator.rb calls
update_attribute
on an order to set the order's email address, but this saves the order without running validations. This saves blank addresses (all fieldsnil
) into the database, which can conflict with validations performed by other gems.If possible, we would like to suggest using an alternate means of setting the email address on a guest order that does not cause the order object to be saved without validations, such as simple attribute assignment (
order.email = ...
).Thanks.
spree_auth_devise/lib/controllers/frontend/spree/checkout_controller_decorator.rb
Line 11 in 50f60a7
The text was updated successfully, but these errors were encountered: