mirror of
https://github.com/basecamp/once-campfire.git
synced 2026-10-07 15:20:08 +09:00
Check for a second page of messages without counting the room
The original room shows its welcome box until it holds more than a page of messages, and paged? answered that with a COUNT(*) over every message in the room on each visit. Asking whether there is a row past the first page answers the same question while reading at most a page of index entries. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NuTtwJKhb77Dv7EQqv2C3C
This commit is contained in:
@@ -49,7 +49,7 @@ module Message::Pagination
|
||||
end
|
||||
|
||||
def paged?
|
||||
count > PAGE_SIZE
|
||||
offset(PAGE_SIZE).exists?
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user