Created
December 12, 2012 23:07
-
-
Save Whiteknight/4272516 to your computer and use it in GitHub Desktop.
If I run this code as-is, the function returns the list of posts as expected. If I uncomment line #4, the function returns an array of nil, breaking my view.
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 posts_in_order | |
ordered = posts.sort{|x, y| x.number <=> y.number } | |
dummy = for i in (0..ordered.length) do | |
#x = ordered[i].number | |
end | |
return ordered | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment