Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Default values #52

Closed
zimt28 opened this issue Mar 27, 2021 · 1 comment
Closed

Default values #52

zimt28 opened this issue Mar 27, 2021 · 1 comment
Labels
bug Something isn't working needs review

Comments

@zimt28
Copy link
Contributor

zimt28 commented Mar 27, 2021

The migration generator uses inspect/1 to generate default values. In case of :decimal types (and maybe others) this leads to invalid defaults:

iex(2)> Decimal.new(0) |> to_string()
"0"
iex(3)> Decimal.new(0) |> inspect()
"#Decimal<0>"
@zimt28 zimt28 added bug Something isn't working needs review labels Mar 27, 2021
@zachdaniel
Copy link
Contributor

Alright, so struct defaults are now passed through to_string(). This should cover most of the relevant cases, but likely not all of them. We can tackle those on a case-by-case basis.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working needs review
Projects
None yet
Development

No branches or pull requests

2 participants