View Source PolymorphicEmbed (Polymorphic Embed v3.0.5)

Link to this section Summary

Link to this section Functions

Link to this function

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

View Source
Link to this function

do_load(data, loader, map)

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]