Better Ruby 1.8.6 compatibility by changing [].count to [].length

git-svn-id: https://dev.finn.de/svn/cockpit/trunk@395 7926756e-e54e-46e6-9721-ed318f58905e
pull/6827/head
hjust 15 years ago
parent 7fcdbeb8cf
commit f1bbbf457f
  1. 4
      lib/access_control_permission_patch.rb

@ -41,7 +41,7 @@ module AccessControlPermissionPatch
found += granulars found += granulars
result = found result = found
while (found.count > 0) && recursive while (found.length > 0) && recursive
found = found.collect{|p| p.inherits(false)}.flatten - result found = found.collect{|p| p.inherits(false)}.flatten - result
result += found result += found
end end
@ -54,7 +54,7 @@ module AccessControlPermissionPatch
end end
result = found = parent_perms(self) result = found = parent_perms(self)
while (found.count > 0) && recursive while (found.length > 0) && recursive
found = found.collect{|p| parent_perms(p)}.flatten - result found = found.collect{|p| parent_perms(p)}.flatten - result
result += found result += found
end end

Loading…
Cancel
Save