View Source Mobilizon.Storage.Ecto (Mobilizon v4.1.0-alpha.1)

Mobilizon Ecto utils

Summary

Functions

Link to this function

convert_ecto_errors(changeset)

View Source
Link to this function

ensure_url(changeset, route)

View Source
@spec ensure_url(Ecto.Changeset.t(), atom()) :: Ecto.Changeset.t()

Ensure changeset contains an URL

If there's a blank URL that's because we're doing the first insert. Most of the time just go with the given URL.

Link to this function

maybe_add_published_at(changeset)

View Source
@spec maybe_add_published_at(Ecto.Changeset.t()) :: Ecto.Changeset.t()
Link to this function

sort(query, sort, direction)

View Source
@spec sort(Ecto.Query.t(), atom(), atom()) :: Ecto.Query.t()

Adds sort to the query.