From 05458624e2dc202074acb2d797953f905659469f Mon Sep 17 00:00:00 2001 From: Armando Fox Date: Tue, 7 Jun 2022 12:24:14 -0700 Subject: [PATCH] changed update_attributes! to update_attribute in Order#finalize!, since the former resets ActiveModel::Errors object, which had just recorded the fact that the payment failed. --- app/models/order.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/order.rb b/app/models/order.rb index c36e43b63..4263b7a1e 100644 --- a/app/models/order.rb +++ b/app/models/order.rb @@ -371,7 +371,7 @@ def finalize!(sold_on_date = Time.current) self.update_attributes!(:authorization => Order::PENDING) # this is a transaction, and also sets updated_at for StaleOrderSweeper if purchase_medium == :credit_card unless (auth = Store::Payment.pay_with_credit_card(self)) - self.update_attributes!(:authorization => nil) # reset order to not-pending state + self.update_attribute(:authorization, nil) # reset order to not-pending state raise(Order::PaymentFailedError, self.errors.as_html) end end