Commit 008eabc0e296f9c7d62865a7a47965dbe9f65243
1 parent
04705f4a
Exists in
master
adding author to comment
Showing
1 changed file
with
2 additions
and
1 deletions
Show diff stats
lib/juventude_plugin/comments_job.rb
| ... | ... | @@ -11,7 +11,7 @@ class JuventudePlugin::CommentsJob < JuventudePlugin::ReportJob |
| 11 | 11 | proposals = ProposalsDiscussionPlugin::Proposal.all |
| 12 | 12 | filepath = "/tmp/#{report_path}/comments.csv" |
| 13 | 13 | CSV.open(filepath, 'w', {:col_sep => ';', :force_quotes => true} ) do |csv| |
| 14 | - csv << ['Id Comentário','Id Proposta','Data', 'Título', 'Conteúdo','Link'] | |
| 14 | + csv << ['Id Comentário','Author','Id Proposta','Data', 'Título', 'Conteúdo','Link'] | |
| 15 | 15 | proposals.map do |proposal| |
| 16 | 16 | count = 0 |
| 17 | 17 | amount_proposal_comments = proposal.comments.count |
| ... | ... | @@ -20,6 +20,7 @@ class JuventudePlugin::CommentsJob < JuventudePlugin::ReportJob |
| 20 | 20 | puts "%s de %s: adicionando comentario da proposta: %s" % [count, amount_proposal_comments, proposal.id ] |
| 21 | 21 | info = [] |
| 22 | 22 | info.push(comment.id) |
| 23 | + info.push((comment.author.nil? ? '' : comment.author.identifier)) | |
| 23 | 24 | info.push(proposal.id) |
| 24 | 25 | info.push(comment.created_at.strftime("%d/%m/%y %H:%M")) |
| 25 | 26 | info.push(comment.title) | ... | ... |