1
0
mirror of https://github.com/LaCasemate/fab-manager.git synced 2025-02-19 13:54:25 +01:00

fix rollback with payzen objects in Db

This commit is contained in:
Sylvain 2021-05-12 16:42:56 +02:00
parent 2c6b3aaa75
commit 358400d69e

View File

@ -177,10 +177,13 @@ class MigrateStripeIdsToPaymentGatewayObjects < ActiveRecord::Migration[5.2]
when 'Stripe::Customer'
'stp_customer_id'
else
raise "Unknown gateway_object_type #{pgo.gateway_object_type}"
puts "Unknown gateway_object_type #{pgo.gateway_object_type}, ignoring..."
nil
end
item = pgo.item
item.update_column(attr, pgo.gateway_object_id)
if attr
item = pgo.item
item.update_column(attr, pgo.gateway_object_id)
end
end
# chain all records