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 })
It looks like adding the primary key as a tie breaker is always in ascending order. This has the side effect that:
won't be an exact reversal of
The work around is simple enough but it would be cool if there was a less verbose way of doing this: