Skip to content

Instantly share code, notes, and snippets.

@athap
Created September 23, 2015 15:02
Show Gist options
  • Save athap/c87f9db3a7cae6923eba to your computer and use it in GitHub Desktop.
Save athap/c87f9db3a7cae6923eba to your computer and use it in GitHub Desktop.
u = User.find 1
// page 1
c1 = u.comments.where(disabled: 0).limit(50).page(1).per(20)
id1 = c1.map(&:id)
//page2
c2 = u.comments.where(disabled: 0).limit(50).page(2).per(20)
id2 = c2.map(&:id)
//page3
c3 = u.comments.where(disabled: 0).limit(50).page(2).per(20)
id3 = c3.map(&:id)
@athap
Copy link
Author

athap commented Sep 23, 2015

I see the issue now. May be we should paginate 50 items

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment