Does attribute `default: _` not set the struct's default value?
It appears that when defining an attribute's
default:
value, it doesn't set the default on the generated struct definition. I would expect it would, like Ecto.Schema
does. Is there a reason it doesn't? Or is there a way of accomplishing this that I couldn't find in the documentation?
3 Replies
We don't do it, would just need to update this: https://github.com/ash-project/ash/blob/main/lib/ash/resource/schema.ex
GitHub
ash/schema.ex at main · ash-project/ash
A declarative and extensible framework for building Elixir applications. - ash/schema.ex at main · ash-project/ash
we'd need to only set default if its not a function
if you want to PR that I'd accept it 😄
Alright, cool. So it's unintentional, and open to PR. Sounds good!