Ash FrameworkAF
Ash Framework3y ago
5 replies
barnabasj

Nested Embeds

Hi,

I'm trying to create a resource with nested Embeds

e.g.

:embed TimeRange

attributes do
  attribute :start, :time
  attribute :end, :time
end

:embed Checkin

attributes
  attribute schedule: TimeRange
  attribute ...
end

:postgres Hotel

attributes do
  attribute :checkin, Checkin
  ...
end


But it seems Ecto cannot load structures like this If I understood this Issue https://github.com/elixir-ecto/ecto/issues/1256 correctly.

Is this just a limitation we have to live with?
GitHub
Given the following schema: defmodule Test.TimeEntry do use Ecto.Schema alias Timex.Ecto.DateTime schema "time_entries" do field :description, :string field :started_at, DateTime ...
Loading an embedded model that has a custom type field never calls ...
Was this page helpful?