diff options
author | Mark Longair <mhl@pobox.com> | 2013-10-31 15:03:27 +0000 |
---|---|---|
committer | Mark Longair <mhl@pobox.com> | 2013-10-31 15:03:27 +0000 |
commit | 1adf7197ec2894eb309994113b67fae5e7d5e903 (patch) | |
tree | 9698535c94f82ebe2acbd3b7552712e4a9eaac06 /app/controllers/public_body_controller.rb | |
parent | 77af1eec1c951c28dd39981f136369ea2a3f6878 (diff) | |
parent | a290c82bdd7369af61b4a5266768382a1755ad1a (diff) |
Merge branch 'stats-graphs-improvements' into rails-3-develop
Diffstat (limited to 'app/controllers/public_body_controller.rb')
-rw-r--r-- | app/controllers/public_body_controller.rb | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/app/controllers/public_body_controller.rb b/app/controllers/public_body_controller.rb index 505325df3..3eb02c4f8 100644 --- a/app/controllers/public_body_controller.rb +++ b/app/controllers/public_body_controller.rb @@ -251,21 +251,21 @@ class PublicBodyController < ApplicationController minimum_requests) end - # We just need the URL and name of each public body: - data['public_bodies'].map! { |pb| - {'name' => pb.name, 'url' => public_body_path(pb)} - } - - data_to_draw = Hash.new { |h, k| h[k] = [] } - data_to_draw.update({ - 'id' => "#{column}-#{highest ? 'highest' : 'lowest'}", - 'x_axis' => _('Public Bodies'), - 'y_axis' => graph_properties[:y_axis], - 'errorbars' => percentages, - 'title' => graph_properties[:title] - }) - if data + # We just need the URL and name of each public body: + data['public_bodies'].map! { |pb| + {'name' => pb.name, 'url' => public_body_path(pb)} + } + + data_to_draw = Hash.new { |h, k| h[k] = [] } + data_to_draw.update({ + 'id' => "#{column}-#{highest ? 'highest' : 'lowest'}", + 'x_axis' => _('Public Bodies'), + 'y_axis' => graph_properties[:y_axis], + 'errorbars' => percentages, + 'title' => graph_properties[:title] + }) + data_to_draw.update(data) data['public_bodies'].each_with_index { |pb, i| data_to_draw['x_values'].push i |