Closed trcarden closed 4 years ago
Interesting. We'll have to start by figuring out of it's the alias or the conversion table that's regressed.
I did a bisect and fortunately it appears to be the most recent commit 7a4b31704dc00c35da186223ac8468bb03e344ff from #126.
I can't promise I'll fix this immediately, so in the mean time @trcarden you can downgrade to 2.5.0
. There's only the one PR in the most recent release.
No, actually that is not correct. The bug persists all the way back to 2.4.0
. The only difference is the conversion table is eagerly calculated in 2.5.1
so @conversion_table_builder.to_h
is called in initialization, not on first use, meaning you trigger the same error on use and not on load.
So this is actually just a thing that's not supported. I guess it could be. But to define a unit system it expects you to define the value by unit name and not by unit alias. It's a feature we could support.
The provided example works by removing the s
and just defining "12 piece"
.
We recently upgraded out gems and moved from measured 2.4 to 2.5.1 and noticed that some of our custom units and aliases stopped working.
Here is a fabricated example:
In measured.rb initializer
Key issue:
pieces
in the value definition fordozen
and that seems to have brokenPrevious/Expected behavior:
Observed behavior: