From 008eabc0e296f9c7d62865a7a47965dbe9f65243 Mon Sep 17 00:00:00 2001 From: Leandro Nunes dos Santos Date: Tue, 20 Oct 2015 10:39:16 -0300 Subject: [PATCH] adding author to comment --- lib/juventude_plugin/comments_job.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/juventude_plugin/comments_job.rb b/lib/juventude_plugin/comments_job.rb index 52db063..0699eb9 100644 --- a/lib/juventude_plugin/comments_job.rb +++ b/lib/juventude_plugin/comments_job.rb @@ -11,7 +11,7 @@ class JuventudePlugin::CommentsJob < JuventudePlugin::ReportJob proposals = ProposalsDiscussionPlugin::Proposal.all filepath = "/tmp/#{report_path}/comments.csv" CSV.open(filepath, 'w', {:col_sep => ';', :force_quotes => true} ) do |csv| - csv << ['Id Comentário','Id Proposta','Data', 'Título', 'Conteúdo','Link'] + csv << ['Id Comentário','Author','Id Proposta','Data', 'Título', 'Conteúdo','Link'] proposals.map do |proposal| count = 0 amount_proposal_comments = proposal.comments.count @@ -20,6 +20,7 @@ class JuventudePlugin::CommentsJob < JuventudePlugin::ReportJob puts "%s de %s: adicionando comentario da proposta: %s" % [count, amount_proposal_comments, proposal.id ] info = [] info.push(comment.id) + info.push((comment.author.nil? ? '' : comment.author.identifier)) info.push(proposal.id) info.push(comment.created_at.strftime("%d/%m/%y %H:%M")) info.push(comment.title) -- libgit2 0.21.2