Merge pull request #175 from kytrinyx/pie-chart-bug

Add heavy-handed tests against pie chart bug
This commit is contained in:
Matt Rogers 2013-03-18 06:41:38 -07:00
commit 0cd6656be2
2 changed files with 157 additions and 3 deletions

View file

@ -350,9 +350,9 @@ class StatsController < ApplicationController
# explicitely copy contents of hash to avoid ending up with two arrays pointing to same hashes
@actions_per_context = Array.new(size){|i| {
'name' => all_actions_per_context[i][:name],
'total' => all_actions_per_context[i][:total].to_i,
'id' => all_actions_per_context[i][:id]
'name' => all_actions_per_context[i]['name'],
'total' => all_actions_per_context[i]['total'].to_i,
'id' => all_actions_per_context[i]['id']
} }
if all_actions_per_context.size > pie_cutoff