PolyAmory (Ecto Poly v1.0.8) View Source
Creates a polymorphic embedded type
Link to this section Summary
Functions
Arguments
types
: Keyword list of{name, type}
. Thename
is stored in the database in order to identify whattype
to use in runtime.type_field
: Name of the field used to the type of that particular object. Default is:__type__
.
Example
defmodule PolyAmory.TestChannelData do
use PolyAmory, types: [
sms: TestSmsChannel,
email: TestEmailChannel,
]
end
Casts the given poly with the changeset parameters.
Link to this section Functions
Arguments
types
: Keyword list of{name, type}
. Thename
is stored in the database in order to identify whattype
to use in runtime.type_field
: Name of the field used to the type of that particular object. Default is:__type__
.
Example
defmodule PolyAmory.TestChannelData do
use PolyAmory, types: [
sms: TestSmsChannel,
email: TestEmailChannel,
]
end
Specs
cast(Ecto.Changeset.t(), atom(), atom(), Keyword.t()) :: Ecto.Changeset.t()
Casts the given poly with the changeset parameters.