Comments (7)
Thanks for the report and apologies for the inconvenience. I had updated all of my libs to work with either Decimal version but I missed that Decimal.parse/1
changed behaviour as well.
I have published money_sql version 1.3.1 to address this issue and it should now be compatible with both Decimal versions 1.x and 2.x.
Updating
Should require no more than:
mix deps.update ex_money_sql
Changelog
- Fixes compatibility with both
Decimal
version1.x
and2.x
. Thanks to @doughsay and @coladarci for the report. Closes #8.
from money_sql.
For context @kipcole9 this is what the error looks like:
** (WithClauseError) no with clause matching: {#Decimal<0.32>, ""}
(ex_money_sql 1.3.0) lib/money/ecto/money_ecto_composite_type.ex:62: Money.Ecto.Composite.Type.cast/1
(ecto 3.4.6) lib/ecto/changeset.ex:559: Ecto.Changeset.cast_field/8
(ecto 3.4.6) lib/ecto/changeset.ex:520: Ecto.Changeset.process_param/7
(elixir 1.10.4) lib/enum.ex:2111: Enum."-reduce/3-lists^foldl/2-0-"/3
(ecto 3.4.6) lib/ecto/changeset.ex:497: Ecto.Changeset.cast/6
when you pass in %{"currency" => "USD", "amount" => "0.32"}
for a Money.Ecto.Composite.Type
from money_sql.
@kipcole9 this update is causing my CI to fail w/ this:
== Compilation error in file lib/cldr/number/parse.ex ==
** (FunctionClauseError) no function clause matching in Keyword.get/3
The following arguments were given to Keyword.get/3:
# 1
nil
# 2
:vsn
# 3
nil
Attempted function clauses (showing 1 out of 1):
def get(+keywords+, +key+, +default+) when -is_list(keywords)- and +is_atom(key)+
Error: (elixir 1.10.4) lib/keyword.ex:201: Keyword.get/3
Error: lib/cldr/number/parse.ex:169: (module)
Error: (stdlib 3.12.1) erl_eval.erl:680: :erl_eval.do_apply/6
from money_sql.
(I'm being told by @doughsay that this is a caching issue in CI... feel free to ignore......... 🤦 )
from money_sql.
Let me know is the issue persists? This error comes from the shim I have in cldr_utils
to do version detection at compile tome on Decimal
which is needed to determine which version of Decimal.compare/2
or Decimal.cmp/2
to use. And the same for Decimal.parse/1
.
The code where is error comes from is:
# cldr_utils/lib/cldr/utils/decimal.ex
decimal_version = Application.ensure_all_started(:decimal) &&
Application.spec(:decimal, :vsn)
|> List.to_string()
from money_sql.
clearing all the CI caches fixed this..
from money_sql.
Thanks for the update. Your CI must have cached a buggy version of cldr_utils
in the one hour period beforeI retired that version in hex.
from money_sql.
Related Issues (20)
- Unmatched clause for `Cldr.Decimal.parse/1` HOT 1
- Composite type cast does not respect locales HOT 5
- Possible bug in ecto? Asking here first for clarification HOT 3
- Broken/Unsupported CompositeType defaults
- Checking if I receive notifications
- function Money.Ecto.Composite.Type.type/0 is undefined or private when using Ecto.Query.Api.type/2 HOT 7
- Getting `type/0` is undefined errors when upgrading HOT 6
- `undefined function migrations_path/1` when attempting to compile HOT 3
- Add keyword list to error return from money_with_currency cast/1 HOT 3
- Add Ecto Changeset validations HOT 1
- Aggregate function treating null as zero amount HOT 1
- Is it able to change the behavior of to_string for `Money.Ecto.Composite.Type` ? HOT 7
- Cast function used to return error when currency is nil HOT 2
- Money.Ecto.Map.Type.embed_as/2 should return :dump instead of :self HOT 2
- Protocol.UndefinedError exception for Jason.Encoder when embedded schema is configured incorrectly with Money.Ecto.Composite.Type HOT 8
- Sum returns ERROR 42804 (datatype_mismatch) HOT 7
- Could not read file error after upgrading to 1.10.0 HOT 4
- Ecto types return malformed error when casting invalid currency HOT 2
- Dependencie issue with ex_money 5.2 HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from money_sql.