Commit 9470cc0ba88e3cee95ca2cb3b8b9efe2045d62cc

Authored by Victor Costa
1 parent 41ef6c0b
Exists in master

Add field in report

Showing 1 changed file with 2 additions and 1 deletions   Show diff stats
lib/dialoga_plugin/report_job.rb
@@ -33,7 +33,7 @@ class DialogaPlugin::ReportJob < Struct.new(:profile_id, :report_path) @@ -33,7 +33,7 @@ class DialogaPlugin::ReportJob < Struct.new(:profile_id, :report_path)
33 CSV.open(filepath, 'w', {:col_sep => ';'} ) do |csv| 33 CSV.open(filepath, 'w', {:col_sep => ';'} ) do |csv|
34 tasks = ProposalsDiscussionPlugin::ProposalTask.all 34 tasks = ProposalsDiscussionPlugin::ProposalTask.all
35 count = 0 35 count = 0
36 - csv << ['Origem', 'Status', 'Criada em', 'Moderado por', 'Data de Moderado', 'Validado por', 'Data de Validado', 'Autor', 'Proposta', 'Categorias'] 36 + csv << ['Tema', 'Origem', 'Status', 'Criada em', 'Moderado por', 'Data de Moderado', 'Validado por', 'Data de Validado', 'Autor', 'Proposta', 'Categorias']
37 status_translation = { 37 status_translation = {
38 1 => 'Pendente de Moderacao', 38 1 => 'Pendente de Moderacao',
39 2 => 'Rejeitada', 39 2 => 'Rejeitada',
@@ -45,6 +45,7 @@ class DialogaPlugin::ReportJob &lt; Struct.new(:profile_id, :report_path) @@ -45,6 +45,7 @@ class DialogaPlugin::ReportJob &lt; Struct.new(:profile_id, :report_path)
45 count += 1 45 count += 1
46 puts "%s de %s: adicionando task: %s" % [count, tasks.count, task.id ] 46 puts "%s de %s: adicionando task: %s" % [count, tasks.count, task.id ]
47 info = [] 47 info = []
  48 + info.push(task.article_parent.nil? ? '' : task.article_parent.categories.join(' '))
48 info.push(task.proposal_source) 49 info.push(task.proposal_source)
49 info.push(status_translation[task.status]) 50 info.push(status_translation[task.status])
50 info.push(task.created_at.strftime("%d/%m/%y %H:%M")) 51 info.push(task.created_at.strftime("%d/%m/%y %H:%M"))