mirror of
https://github.com/maybe-finance/maybe.git
synced 2025-08-05 13:35:21 +02:00
Multi-currency support: Money + Currency class improvements (#553)
* Money improvements * Replace all old money usage
This commit is contained in:
parent
e5750d1a13
commit
fe2fa0eac1
43 changed files with 2982 additions and 196 deletions
|
@ -2,13 +2,6 @@ class ReplaceMoneyField < ActiveRecord::Migration[7.2]
|
|||
def change
|
||||
add_column :accounts, :balance_cents, :integer
|
||||
change_column :accounts, :balance_cents, :integer, limit: 8
|
||||
|
||||
Account.reset_column_information
|
||||
|
||||
Account.find_each do |account|
|
||||
account.update_columns(balance_cents: Money.from_amount(account.balance_in_database, account.currency).cents)
|
||||
end
|
||||
|
||||
remove_column :accounts, :balance
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue