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:dungavjk@mail.uc.edu AND has_model_ssim:Article', fl: "id", rows: 1000)
work_ids.each do |work|
pid = work['id']
article = Article.find(pid)
article.depositor = 'konecnmc@ucmail.uc.edu'
article.edit_users = ['konecnmc@ucmail.uc.edu']
article.save
article.file_sets.each do |file|
file.depositor = 'konecnmc@ucmail.uc.edu'
file.edit_users = ['konecnmc@ucmail.uc.edu']
file.creator = ['konecnmc@ucmail.uc.edu']
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