View Source Dropkick.Context (dropkick v0.0.1)

Link to this section Summary

Functions

Deletes a changeset with its associated files. This function relies on Ecto.Multi to persist the attached information in the same transaction and it accepts the same options as Ecto.Repo.update/2.

Inserts a changeset with its associated files. This function relies on Ecto.Multi to persist the attached information in the same transaction and it accepts the same options as Ecto.Repo.insert/2.

Updates a changeset with its associated files. This function relies on Ecto.Multi to persist the attached information in the same transaction and it accepts the same options as Ecto.Repo.update/2.

Link to this section Functions

Link to this function

delete_with_files(changeset, uploader, opts \\ [])

View Source

Deletes a changeset with its associated files. This function relies on Ecto.Multi to persist the attached information in the same transaction and it accepts the same options as Ecto.Repo.update/2.

examples

Examples

def delete_user(user, attrs) do
  user
  |> User.changeset(attrs)
  |> update_with_files(MyApp.Uploader)
end
Link to this function

insert_with_files(changeset, uploader, opts \\ [])

View Source

Inserts a changeset with its associated files. This function relies on Ecto.Multi to persist the attached information in the same transaction and it accepts the same options as Ecto.Repo.insert/2.

examples

Examples

def create_user(user, attrs) do
  user
  |> User.changeset(attrs)
  |> insert_with_files(MyApp.Uploader)
end
Link to this function

update_with_files(changeset, uploader, opts \\ [])

View Source

Updates a changeset with its associated files. This function relies on Ecto.Multi to persist the attached information in the same transaction and it accepts the same options as Ecto.Repo.update/2.

examples

Examples

def update_user(user, attrs) do
  user
  |> User.changeset(attrs)
  |> update_with_files(MyApp.Uploader)
end