mirror of
https://github.com/maybe-finance/maybe.git
synced 2025-08-08 23:15:24 +02:00
Add test cases for multi-currency investment syncing
This commit is contained in:
parent
0691041d37
commit
993be6615a
5 changed files with 101 additions and 23 deletions
|
@ -200,6 +200,11 @@ class Account::Entry < ApplicationRecord
|
|||
end
|
||||
|
||||
def trade_valid?
|
||||
if account_trade.currency != currency
|
||||
# i18n-tasks-use t('activerecord.errors.models.account/entry.attributes.base.currency_mismatch')
|
||||
errors.add(:base, :currency_mismatch)
|
||||
end
|
||||
|
||||
if account_trade.sell?
|
||||
current_qty = account.holding_qty(account_trade.security)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue