Skip to content
This repository has been archived by the owner on Jan 8, 2022. It is now read-only.

Commit

Permalink
Filter out items and collections from being exported if they have a c…
Browse files Browse the repository at this point in the history
…atkey

Connects to sul-dlss/happy-heron#1199
  • Loading branch information
mjgiarlo authored and jcoyne committed Jun 3, 2021
1 parent 9db561d commit 8ae3120
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
9 changes: 8 additions & 1 deletion bin/export-collections
Original file line number Diff line number Diff line change
Expand Up @@ -67,4 +67,11 @@ end

warn "Exporting #{list.count} collections"

puts list.map { |collection| serialize(collection).to_json }.compact
list.map do |collection|
if collection.catkey.present?
warn "Skipping #{collection.pid} because it has a catkey"
next
end

puts serialize(collection).to_json
end
3 changes: 3 additions & 0 deletions bin/export-items
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,9 @@ list.each do |item|
if item.apo_pid == GRAVEYARD_APO
warn "Skipping #{item.pid} because it belongs to the Graveyard APO"
next
elsif item.catkey.present?
warn "Skipping #{item.pid} because it has a catkey"
next
end
attributes = serialize(item)
puts attributes.compact.to_json
Expand Down

0 comments on commit 8ae3120

Please sign in to comment.