Because that before_action was running on all actions of the controller, and our update_registration action used update_attribute, which skips validations, this could sometimes save invalid empty addresses onto guest orders.
This PR solves this by skipping the before action for update_registration. We also switch to using update_attributes so that validation are run (this would have helped us catch this sooner).
See solidusio/solidus#1588 for reproduction steps.
The
checkout_controller
has abefore_action :setup_for_current_state
which builds addresses onto the order association if the order is in the "address state".Because that before_action was running on all actions of the controller, and our
update_registration
action used update_attribute, which skips validations, this could sometimes save invalid empty addresses onto guest orders.This PR solves this by skipping the before action for
update_registration
. We also switch to usingupdate_attributes
so that validation are run (this would have helped us catch this sooner).