Skip to content

Commit

Permalink
#3566 Add column contributors in metadata csv
Browse files Browse the repository at this point in the history
  • Loading branch information
symmetrically committed Aug 11, 2023
1 parent 46b971f commit 9dac0cc
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions app/controllers/concerns/export_service.rb
Original file line number Diff line number Diff line change
Expand Up @@ -407,7 +407,8 @@ def export_work_metadata_as_csv(collection)
'Pages Translated',
'Pages Needing Review',
'Pages Marked Blank',
'work_id'
'work_id',
'Contributors Users'
]

raw_metadata_strings = collection.works.pluck(:original_metadata)
Expand All @@ -418,7 +419,9 @@ def export_work_metadata_as_csv(collection)

csv << static_headers + metadata_headers + static_description_headers + described_headers

collection.works.includes(:document_sets, :work_statistic, :sc_manifest).reorder(:id).each do |work|
collection.works.includes(:document_sets, :work_statistic, :sc_manifest).reorder(:id).each do |work|

work_users = work.deeds.map{ |d| "#{d.user.display_name}<#{d.user.email}>".gsub('|', '//') }.uniq.join('|')
row = [
work.title,
work.collection.title,
Expand All @@ -437,7 +440,8 @@ def export_work_metadata_as_csv(collection)
work.work_statistic.translated_pages,
work.work_statistic.needs_review,
work.work_statistic.blank_pages,
work.id
work.id,
work_users
]

unless work.original_metadata.blank?
Expand Down

0 comments on commit 9dac0cc

Please sign in to comment.