ecto_ranked v0.5.0 EctoRanked
This module provides support for automatic ranking of your Ecto models.
Link to this section Summary
Functions
Updates the given changeset with the appropriate ranking, and updates/ranks the other items in the list as necessary
Link to this section Functions
Link to this function
set_rank(changeset, opts \\ [])
set_rank(changeset, opts \\ [])
set_rank(Ecto.Changeset.t(), Keyword.t()) :: Ecto.Changeset.t()
set_rank(Ecto.Changeset.t(), Keyword.t()) :: Ecto.Changeset.t()
Updates the given changeset with the appropriate ranking, and updates/ranks the other items in the list as necessary.
Options
:rank
- the field to store the actual ranking in. Defaults to:rank
:position
- the field to use for positional changes. Defaults to:position
:scope
- the field(s) to scope all rankings to. Defaults tonil
(no scoping).:prefix
- the prefix to run all queries on (e.g. the schema path in Postgres). Defaults tonil
(no prefix).