Skip to content

Primary keys go in ascending order even if other columns are descending. #23

Description

@thijsnado

It looks like adding the primary key as a tie breaker is always in ascending order. This has the side effect that:

page.cursor_paginate(order: { name: :desc })

won't be an exact reversal of

page.cursor_paginate(order: { name: :asc })

The work around is simple enough but it would be cool if there was a less verbose way of doing this:

# asc
page.cursor_paginate(order: { name: :asc, id: :asc })

# desc, in reverse order
page.cursor_paginate(order: { name: :desc, id: :desc })

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions