I found possible bug with Ash.DataLayer.Mnesia in form validation
I'm writing the Tunez code using Mnesia, and I came across this difference.
form = AshPhoenix.Form.for_create(Tunez.Music.Artist, :create)
AshPhoenix.Form.validate(form, %{name: "Best Band Ever"}) # returning valid
#AshPhoenix.Form<
resource: Tunez.Music.Artist,
action: :create,
type: :create,
params: %{name: "Best Band Ever"},
source: #Ash.Changeset<
domain: Tunez.Music,
action_type: :create,
action: :create,
attributes: %{},
relationships: %{},
errors: [],
data: %Tunez.Music.Artist{
id: nil,
name: nil,
biography: nil,
inserted_at: nil,
updated_at: nil,
__meta__: #Ecto.Schema.Metadata<:built, "">
},
valid?: true
>,
name: "form",
data: nil,
form_keys: [],
forms: %{},
domain: Tunez.Music,
method: "post",
submit_errors: nil,
id: "form",
transform_errors: nil,
original_data: nil,
transform_params: nil,
prepare_params: nil,
prepare_source: nil,
raw_params: %{name: "Best Band Ever"},
warn_on_unhandled_errors?: true,
any_removed?: false,
added?: false,
changed?: false,
touched_forms: MapSet.new([:name]),
valid?: true,
errors: true,
submitted_once?: false,
just_submitted?: false,
...
>form = AshPhoenix.Form.for_create(Tunez.Music.Artist, :create)
AshPhoenix.Form.validate(form, %{name: "Best Band Ever"}) # returning valid
#AshPhoenix.Form<
resource: Tunez.Music.Artist,
action: :create,
type: :create,
params: %{name: "Best Band Ever"},
source: #Ash.Changeset<
domain: Tunez.Music,
action_type: :create,
action: :create,
attributes: %{},
relationships: %{},
errors: [],
data: %Tunez.Music.Artist{
id: nil,
name: nil,
biography: nil,
inserted_at: nil,
updated_at: nil,
__meta__: #Ecto.Schema.Metadata<:built, "">
},
valid?: true
>,
name: "form",
data: nil,
form_keys: [],
forms: %{},
domain: Tunez.Music,
method: "post",
submit_errors: nil,
id: "form",
transform_errors: nil,
original_data: nil,
transform_params: nil,
prepare_params: nil,
prepare_source: nil,
raw_params: %{name: "Best Band Ever"},
warn_on_unhandled_errors?: true,
any_removed?: false,
added?: false,
changed?: false,
touched_forms: MapSet.new([:name]),
valid?: true,
errors: true,
submitted_once?: false,
just_submitted?: false,
...
>