- newer_items = page_items.count.positive? && items.exists?(["#{id_column} > ?", page_items.first.id])
- older_items = page_items.count.positive? && items.exists?(["#{id_column} < ?", page_items.last.id])
+ newer_items_id = page_items.first.id if page_items.count.positive? && items.exists?(["#{id_column} > ?", page_items.first.id])
+ older_items_id = page_items.last.id if page_items.count.positive? && items.exists?(["#{id_column} < ?", page_items.last.id])