From 6ca0d737c31d24e7a5e803719f4f0019fa489eb8 Mon Sep 17 00:00:00 2001 From: Mohamed Wael Khobalatte Date: Thu, 15 Oct 2015 19:43:51 +0100 Subject: [PATCH] Ensure no new lines accidentally inserted in js string --- app/helpers/burndown_charts_helper.rb | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/app/helpers/burndown_charts_helper.rb b/app/helpers/burndown_charts_helper.rb index 6e049f0bdb..b350948d90 100644 --- a/app/helpers/burndown_charts_helper.rb +++ b/app/helpers/burndown_charts_helper.rb @@ -54,11 +54,9 @@ module BurndownChartsHelper # 14 entries (plus the axis label) have come along as the best value for a good optical result. # Thus it is enough space between the entries. entries_displayed = (burndown.days.length / 14.0).ceil - burndown.days.enum_for(:each_with_index).map do |d, i| + result = burndown.days.enum_for(:each_with_index).map do |d, i| if ((i % entries_displayed) == 0) - "[#{i + 1}, - '#{escape_javascript(::I18n.t('date.abbr_day_names')[d.wday % 7])} - #{d.strftime('%d/%m')}']" + "[#{i + 1}, '#{escape_javascript(::I18n.t('date.abbr_day_names')[d.wday % 7])} #{d.strftime('%d/%m')}']" end end.join(',').html_safe + ", [#{burndown.days.length + 1},