Hacker News new | ask | show | jobs
by second_brekkie 952 days ago
This is a nice article. I've used Ecto embedded schemas and nimble options separately but never thought to use them together.

Faced with this kind of issue, I'd use Ash with the `Simple` data layer. You can get all the power of an embedded Ecto schema and nimble options together in a single dsl.

If you need to validate with arbitrary logic you can do that with a 'validation'

If you need to transform the input data before you return the struct you can do it in a change set.

It's all there!