Skip to content

Instantly share code, notes, and snippets.

@scherztc
Last active April 27, 2019 06:23
Show Gist options
  • Save scherztc/af5422e066221d60f18fbf58df412e17 to your computer and use it in GitHub Desktop.
Save scherztc/af5422e066221d60f18fbf58df412e17 to your computer and use it in GitHub Desktop.
Change ownership on works and files
work_ids = ActiveFedora::SolrService.query('depositor_ssim:[email protected] AND has_model_ssim:Article', fl: "id", rows: 1000)
work_ids.each do |work|
pid = work['id']
article = Article.find(pid)
article.depositor = '[email protected]'
article.edit_users = ['[email protected]']
article.save
article.file_sets.each do |file|
file.depositor = '[email protected]'
file.edit_users = ['[email protected]']
file.creator = ['[email protected]']
file.save
end
end
Becks - Articles 52
Peck - Articles 48
Dunga - Article 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment