EctoMorph.update_struct

You're seeing just the function update_struct, go back to EctoMorph module for more information.
Link to this function

update_struct(struct_to_update, data)

View Source

Specs

update_struct(ecto_struct(), map()) :: okay_struct() | error_changeset()

Attempts to update the given Ecto Schema struct with the given data by casting data and merging it into the struct. Uses cast and changesets to recursively update any nested relations also.

Accepts a whitelist of fields for which updates can take place on. The whitelist can be arbitrarily nested, and Data may be a map, or another struct of any kind. See examples below.

Examples

iex> MyApp.Repo.get(Thing, 10) |> EctoMorph.update

As with cast_to_struct, the data you are updating struct you are updating can be a

Link to this function

update_struct(struct_to_update, data, field_whitelist)

View Source

Specs

update_struct(ecto_struct(), map(), list()) :: okay_struct() | error_changeset()