revert hard coded Guthaben
This commit is contained in:
parent
bcc647dabb
commit
bdeee02873
2 changed files with 16 additions and 1 deletions
|
|
@ -0,0 +1,15 @@
|
|||
class ChangeGroupOrderInvoicePaymentMethod < ActiveRecord::Migration[7.0]
|
||||
def change
|
||||
GroupOrderInvoice.all.each do |group_order_invoice|
|
||||
case group_order_invoice.payment_method
|
||||
when 'Guthaben'
|
||||
group_order_invoice.payment_method = 'Guthaben'
|
||||
when /\A\d+\z/
|
||||
group_order_invoice.payment_method = FinancialTransactionType.find_by(id: group_order_invoice.payment_method)&.name || 'Guthaben'
|
||||
else
|
||||
group_order_invoice.payment_method = group_order_invoice.payment_method || 'Guthaben'
|
||||
end
|
||||
group_order_invoice.save!
|
||||
end
|
||||
end
|
||||
end
|
||||
Loading…
Add table
Add a link
Reference in a new issue