/2.rb Secret
Created
April 29, 2014 21:32
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
pages.sort { |a,b| a.display != b.display ? (a.display && !b.display ? -1 : 1) : a.display ? a.position <=> b.position : a.title <=> b.title } | |
#### | |
pages.sort { | |
|a,b| | |
if a.display != b.display | |
if a.display && !b.display | |
-1 | |
else | |
1 | |
end | |
else | |
if a.display? | |
a.position <=> b.position | |
if | |
a.title <=> b.title | |
end | |
end | |
end | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment