Created
June 7, 2013 22:13
-
-
Save marcusramberg/5732782 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
json.array! @ranking.results_with_change.each_with_index.to_a do |args| | |
# We can't unpack the args in the block param because Jbuilder does | |
# something magic. | |
(user, player, diff), index = *args | |
json.rank index+1 | |
json.user user, :id, :facebook_id, :name, :square_avatar | |
json.score player.r.to_i | |
json.change_today diff.to_i | |
json.r player.r | |
json.rd player.rd | |
json.vol player.vol | |
end | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Nice hack 😄