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 \\ [])

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 to nil (no scoping).
  • :prefix - the prefix to run all queries on (e.g. the schema path in Postgres). Defaults to nil (no prefix).