forgeplus/app/views/users/headmaps/index.json.jbuilder

6 lines
233 B
Ruby

json.total_contributions @headmaps.collect{|map| map["contributions"]}.reduce(0, :+)
json.headmaps @headmaps.each do |map|
json.date Time.at(map["timestamp"].to_i).strftime("%Y-%m-%d")
json.contributions map["contributions"]
end