Last active
March 2, 2016 12:21
-
-
Save hedgerh/0d7f31b6686c417d58b0 to your computer and use it in GitHub Desktop.
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
foo = [{ order: 1 }, { order: 2 }, { order: 3 }, { order: 4 }] | |
# First Attempt | |
nextPage = foo.select{ |f| f.order == current.order+1 } || foo.select{ |f| f.order == 1 } | |
# Second Attempt | |
nextPage = foo.select{ |f| f.order == current.order+1 || f.order == 1 } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment