Skip to content
Snippets Groups Projects
Commit 5d4cfa2a authored by dgt's avatar dgt
Browse files

Fix: no nil values in group list

parent ef2c6157
Branches 295-bug-in-namespace-function
No related tags found
No related merge requests found
...@@ -50,7 +50,7 @@ module Group::Groups ...@@ -50,7 +50,7 @@ module Group::Groups
ids = [ids] unless ids.is_a? Array ids = [ids] unless ids.is_a? Array
return [] unless ids.any? return [] unless ids.any?
parentids = parent_ids(ids) parentids = parent_ids(ids)
(ids + parentids + committee_ids(ids + parentids)).flatten.uniq (ids + parentids + committee_ids(ids + parentids)).flatten.uniq.compact
end end
# returns an array of committee ids given an array of group ids. # returns an array of committee ids given an array of group ids.
...@@ -59,7 +59,7 @@ module Group::Groups ...@@ -59,7 +59,7 @@ module Group::Groups
end end
def parent_ids(ids) def parent_ids(ids)
Group.where(id: ids).pluck(:parent_id) Group.where(id: ids).pluck(:parent_id).compact
end end
def can_have_committees? def can_have_committees?
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment