Embedded Resource default value causes compilation error
I have a fairly simple embedded resource:
and a simple validation:
8 Replies
In the parent resource, when I use it without a default value, everything works fine, but as soon as I give it a default value, it fails:
Interesting...
yeah its trying to cast the default value to the embed at compile time
but its not safe to do that in that instance because it needs the time zone database running
I see. Is this something that needs to be considered in core Ash?
I think you need to set the default value to a function perhaps
Solution
default: fn -> %{} end
in this caseAs I have a default value I just skip the call using
oh, that should probably work too
you're saying that works?
Yes, this works
Let me check the function default, too
This works as well