View Source PolymorphicEmbed (Polymorphic Embed v5.0.0)

Summary

Types

Functions

Link to this function

cast_polymorphic_embed(changeset, field, cast_opts \\ [])

View Source
Link to this function

do_load(data, loader, field_opts)

View Source
Link to this function

get_polymorphic_module(schema, field, type_or_data)

View Source
Link to this function

get_polymorphic_type(schema, field, module_or_struct)

View Source
Link to this macro

polymorphic_embeds_many(field_name, opts)

View Source (macro)
Link to this macro

polymorphic_embeds_one(field_name, opts)

View Source (macro)
Link to this function

traverse_errors(changeset, msg_func)

View Source

Returns the possible types for a given schema and field

you can call types/2 like this:

PolymorphicEmbed.types(MySchema, :contexts)
#=> [:location, :age, :device]