The default amount should be set via defaults
#257
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I've noticed a regression in the codebase, introduced in #227 (a09a2d4 to be exact). It broke the following use case of mine:
Every user can own multiple wallets with different currencies, thus the UNIQUE index on both
owner_id
andbalance_currency
.The problem lies in the changes to the behaviour of
_expand_money_kwargs
. They made following code snippet......produce following query and error:
_expand_money_kwargs
set the value ofmoney
to the default value of the field, which should not be the correct behaviour.This pull requests fixes the issues with all the tests passing. It is however a quickfix and feels a bit hacky. I feel also like
_expand_money_kwargs
is a bit messy and there may be more bugs hiding in there. You are welcome to review the change and suggest improvements! 馃檶馃徎