diff app/helpers/projects_helper.rb @ 1507:9f37f7e39d3c cannam

Fixes to the prior commit
author Chris Cannam <chris.cannam@soundsoftware.ac.uk>
date Fri, 21 Mar 2014 13:37:39 +0000
parents fb773fcf9af8
children afce8026aaeb
line wrap: on
line diff
--- a/app/helpers/projects_helper.rb	Fri Mar 21 13:20:11 2014 +0000
+++ b/app/helpers/projects_helper.rb	Fri Mar 21 13:37:39 2014 +0000
@@ -313,7 +313,7 @@
     threshold = scores[scores.length / 2]
     if threshold == 0 then threshold = 1 end
     mhash = Hash.new
-    phash.keys.select do |k|
+    phash.keys.shuffle.select do |k|
       if phash[k] < threshold or k.description == "" then
         false
       else
@@ -321,7 +321,7 @@
         mgrs = []
         u.keys.each do |r|
           if r.allowed_to?(:edit_project)
-            mgrs << u[r]
+            u[r].each { |m| mgrs << m }
           end
         end
         novel = (mhash.keys & mgrs).empty?