diff --git a/lib/dialoga_plugin/ranking_job.rb b/lib/dialoga_plugin/ranking_job.rb index 0b0172a..62082ca 100644 --- a/lib/dialoga_plugin/ranking_job.rb +++ b/lib/dialoga_plugin/ranking_job.rb @@ -19,7 +19,7 @@ class DialogaPlugin::RankingJob < DialogaPlugin::ReportJob filepath = "/tmp/#{report_path}/ranking-#{discussion.slug}_#{article.slug}.csv" CSV.open(filepath, 'w', {:col_sep => ';', :force_quotes => true}) do |csv| csv << ['Posição', 'Id', 'Proposta', 'Positivo', 'Negativo', 'Exibições', 'Valor', 'Autor', 'Email do Autor'] - ranking.each_with_index {|r, i| csv << [r.position, r.id, r.abstract, r.votes_for, r.votes_against, r.hits, r.effective_support, r.proposal.created_by.present? ? r.proposal.created_by.name : r.proposal.author_name, r.proposal.created_by.present? ? r.proposal.created_by.email : ''].flatten} + ranking.each_with_index {|r, i| csv << [r.position, r.id, r.abstract, r.votes_for, r.votes_against, r.hits, r.effective_support, r.proposal.author.present? ? r.proposal.author.name : r.proposal.author_name, r.proposal.author.present? ? r.proposal.author.email : ''].flatten} end end end -- libgit2 0.21.2