Code of Conduct
AI Policy
Versions
ash_ai 0.5.0, ash 3.5.7
Issue
Using prepare build(select: [...]) in an action causes the serializer to crash when serializing records with %Ash.NotLoaded{} attribute values.
(FunctionClauseError) no function clause matching in Decimal.to_string/2
Cause
The serializer skips NotLoaded for relationships, calculations, and aggregates, but not for attributes.
Fix
Add the same check for attributes after line 148:
match?(%Ash.Resource.Attribute{}, field) &&
match?(%Ash.NotLoaded{}, Map.get(record, field.name)) ->
acc