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

Add support for value of money to cast when field type is Money.Ecto.Map.Type #205

Open
uzairaslam196 opened this issue Jun 14, 2023 · 0 comments

Comments

@uzairaslam196
Copy link

I am currently working on an Elixir project with multiple currencies; I need currency code with the amount from form input to cast directly using changeset. However, I discovered that form sends money in a string format similar to this "$99", which cannot be cast by the Money.Ecto.Map.Type type as it expects map. So, I believe it should send the value as a map, similar to this %{"amount" => 99, "currency" => "USD"} so that it can be easily cast by changeset when the type is Money.Ecto.Map.Type.

Same issue happens when we use Money.Ecto.Map.Type

Currently, I have to update form input values explicitly into map to cast them in changeset.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant