I am using, for better or worse, the Spree commerce gem.
I have added a new attribute and column to the Spree::Order model and am overriding the update_registration
action on the CheckoutController. When calling the update_registration action, I can see the contents of the form being sent via params:
Processing by Spree::CheckoutController#update_registration as HTML "order"=>{"email"=>"[email protected]", "new_attribute"=>"Bob"}, "commit"=>"Continue to checkout"
Which is process by a simple command object:
def call
order.update(params)
end
There are no log entries following that indicating any form of problem or rollback. I then see:
Spree::Order Update (1.4ms) UPDATE "spree_orders" SET "email" = $1, "updated_at" = $2 WHERE "spree_orders"."id" = $3 [["email", "[email protected]"], ["updated_at", "2020-07-23 11:43:29.461912"], ["id", 338]]
Which succeeds. Seemingly, the update method on the model is ignoring the new attribute. I can confirm this in via the console in the database.
I have specs that demonstrate the desired behaviour and indeed it works locally. I am tearing my hair out, quite literally, and I don't have that much to start with. This isn't my first Rails rodeo but cannot for the life of me understand what is going on here. It is bizarre.