Alex Slade
Alex Slade
AEAsh Elixir
Created by gvanders on 5/10/2023 in #support
Polymorphic Embedded Resources?
@Zach Daniel sorry to dig up an old post, but what's the lowest-pain way of doing this? I'm trying to do something similar where a resource has an embedded resource which could be 1 of ~5 types. The types are fairly complex (they each represent external API data from a different provider) Will a union type cause more headaches than, say, having 5 attributes; leaving them all nil except for the one that matches the type we want to use. I'm aiming for an easy story for things like validations and form editing.
14 replies