mirror of
https://github.com/maybe-finance/maybe.git
synced 2025-08-03 20:45:21 +02:00
fix: money migration (#354)
This commit is contained in:
parent
5de5199459
commit
88b4f2fb6b
1 changed files with 1 additions and 1 deletions
|
@ -6,7 +6,7 @@ class ReplaceMoneyField < ActiveRecord::Migration[7.2]
|
||||||
Account.reset_column_information
|
Account.reset_column_information
|
||||||
|
|
||||||
Account.find_each do |account|
|
Account.find_each do |account|
|
||||||
account.update_columns(balance_cents: Money.from_amount(account.balance, account.currency).cents)
|
account.update_columns(balance_cents: Money.from_amount(account.balance_in_database, account.currency).cents)
|
||||||
end
|
end
|
||||||
|
|
||||||
remove_column :accounts, :balance
|
remove_column :accounts, :balance
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue