Skip to content

Commit

Permalink
Cast to arrays to avoid nils
Browse files Browse the repository at this point in the history
  • Loading branch information
cjcolvar committed Feb 16, 2024
1 parent 23646c3 commit 51c7e1f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions app/presenters/admin/collection_presenter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -43,15 +43,15 @@ def unpublished_media_object_count
end

def managers
@managers ||= document["edit_access_person_ssim"] & (document["collection_managers_ssim"] || [])
@managers ||= Array(document["edit_access_person_ssim"]) & Array(document["collection_managers_ssim"])
end

def editors
@editors ||= document["edit_access_person_ssim"] - managers
@editors ||= Array(document["edit_access_person_ssim"]) - managers
end

def depositors
document["read_access_person_ssim"]
Array(document["read_access_person_ssim"])
end

def manager_count
Expand Down

0 comments on commit 51c7e1f

Please sign in to comment.