> > I'd keep the default order as ORDER BY created_at DESC, id DESC, but change
> > the WHERE id > $marker to the other direction: WHERE id < $marker. When we
> do
> > custom ordering, the direction (> or <) will be determined by the direction
> of
> > the sort order. Am I correct in that thinking?
>
> Yes sir. So I think what I have should be good, assuming you understand why I
> am first doing a comparison on created_at.
Yep.
And you understand in the future for custom ordering, you only need to do the or_ expression when the order is on a field that does not have a unique index :)
> > I'd keep the default order as ORDER BY created_at DESC, id DESC, but change
> > the WHERE id > $marker to the other direction: WHERE id < $marker. When we
> do
> > custom ordering, the direction (> or <) will be determined by the direction
> of
> > the sort order. Am I correct in that thinking?
>
> Yes sir. So I think what I have should be good, assuming you understand why I
> am first doing a comparison on created_at.
Yep.
And you understand in the future for custom ordering, you only need to do the or_ expression when the order is on a field that does not have a unique index :)
-jay