Skip to content
This repository has been archived by the owner on Jun 27, 2020. It is now read-only.

Commit

Permalink
Add collection creation date to collection summary report.
Browse files Browse the repository at this point in the history
  • Loading branch information
Jim Coble committed Jul 20, 2018
1 parent ad6e936 commit bca2717
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions reports/collection_summary.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
headers = [
"PID",
"COLLECTION TITLE",
"CREATION DATE",
"ADMIN SET",
"OBJECT COUNT",
"WORKFLOW STATE",
Expand All @@ -23,7 +24,7 @@
csv << headers
collections = Ddr::Index::Query.new do
model "Collection"
fields :id, :title, :admin_set, :workflow_state, :internal_uri
fields :id, :title, :object_profile, :admin_set, :workflow_state, :internal_uri
end
collections.docs.each do |doc|
objects = Ddr::Index::Query.new { is_governed_by doc.id }
Expand All @@ -34,7 +35,8 @@
end
total_size = content.docs.map(&:content_size).reduce(0, :+)
human_size = ActiveSupport::NumberHelper.number_to_human_size(total_size)
csv << [doc.id, doc.title, doc.admin_set, objects.count, doc.workflow_state, human_size, total_size]
creation_date = doc.object_create_date.strftime('%Y-%m-%d') rescue nil
csv << [doc.id, doc.title, creation_date, doc.admin_set, objects.count, doc.workflow_state, human_size, total_size]
end
end
mail = ReportMailer.basic(to: email_addrs,
Expand Down

0 comments on commit bca2717

Please sign in to comment.