Commit 5d4cfa2a authored by dgt's avatar dgt

Fix: no nil values in group list

parent ef2c6157
......@@ -50,7 +50,7 @@ module Group::Groups
ids = [ids] unless ids.is_a? Array
return [] unless ids.any?
parentids = parent_ids(ids)
(ids + parentids + committee_ids(ids + parentids)).flatten.uniq
(ids + parentids + committee_ids(ids + parentids)).flatten.uniq.compact
end
# returns an array of committee ids given an array of group ids.
......@@ -59,7 +59,7 @@ module Group::Groups
end
def parent_ids(ids)
Group.where(id: ids).pluck(:parent_id)
Group.where(id: ids).pluck(:parent_id).compact
end
def can_have_committees?
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment