Hey @acalejos! 👋
Playing around with Flint, how would I control how an embedded_schema gets saved in the database? I have:
defmodule App.PersonData do
use Flint.Schema, extensions: [Accessible, Embedded, JSON]
embedded_schema do
field :name, :string, omitempty: true
field :slug, :string
end
end
defmodule App.Person do
use Flint.Schema
schema "people" do
embeds_one :data, App.PersonData
end
end
When I Repo.insert! with the name field blank, the database still shows %{name: null}, but running Repo.insert! |> Jason.encode! returns the expected result
Hey @acalejos! 👋
Playing around with Flint, how would I control how an embedded_schema gets saved in the database? I have:
When I
Repo.insert!with the name field blank, the database still shows %{name: null}, but runningRepo.insert! |> Jason.encode!returns the expected result