mirror of
https://github.com/we-promise/sure.git
synced 2026-04-19 12:04:08 +00:00
Multi-currency support: Money + Currency class improvements (#553)
* Money improvements * Replace all old money usage
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user