Reorderex v0.2.0-beta Reorderex.Ecto View Source
Reorderex.Ecto
Link to this section Summary
Functions
Moves the given entity
to after an entity at after_id
using Ecto repo
.
Link to this section Functions
Moves the given entity
to after an entity at after_id
using Ecto repo
.
Example
photo
|> Reorderex.Ecto.insert_after(photo1.id, Repo)
|> Repo.update()
Options
:field
- The field that store score of each row. Default to:score
.:query
- In the case of ordering on shared table, query should narrow down Ecto model so a smaller set that contains the givenentity
and the entity atafter_id
.