-
-
Save handshake-engineering-blog/2e2db96d9299477bda78b7516a005bd3 to your computer and use it in GitHub Desktop.
1977385383_04
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def results | |
@_results ||= begin | |
# If there’s an after cursor, decode it and only query for records with an id that come after that cursor | |
@items = @items.where('id > ?', Base64.decode64(@after_value)) if @after_value.present? | |
@items.limit(page_size + 1) # Fetch one extra result to determine if there's another page | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment