Skip to content

Commit

Permalink
avoid versions without a parent in upgrade task #770
Browse files Browse the repository at this point in the history
  • Loading branch information
stuzart committed Nov 1, 2021
1 parent c4870eb commit c177de1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/tasks/seek_upgrades.rake
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ namespace :seek do
puts "... Setting version visibility..."
disable_authorization_checks do
[DataFile::Version, Document::Version, Model::Version, Node::Version, Presentation::Version, Sop::Version, Workflow::Version].each do |klass|
scope = klass.where(visibility: nil)
scope = klass.where(visibility: nil).where.not(parent:nil)
count = scope.count
if count == 0
puts " No #{klass.name} with unset visibility found, skipping"
Expand Down

0 comments on commit c177de1

Please sign in to comment.