Created
April 3, 2014 04:46
-
-
Save yangxing-star/9948417 to your computer and use it in GitHub Desktop.
替换大使PK头像
This file contains hidden or 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
l=Leaderboard.find('530fe34025d9803aa5001a68') | |
l.users.each do |uid, u| | |
user = {} | |
referring = {} | |
user[:nickname] = u[:nickname] | |
user[:avatar_url] = User.find(uid).avatar.url('58x58') | |
user[:city] = u[:city] | |
user[:referred_at] = u[:referred_at] | |
u[:referring].each do |k, v| | |
hash = {} | |
hash[:nickname] = v[:nickname] | |
hash[:avatar_url] = User.find(k).avatar.url('58x58') | |
hash[:city] = u[:city] | |
hash[:referred_at] = u[:referred_at] | |
referring[k] = hash | |
end | |
user[:referring] = referring | |
l.users[uid] = user | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment