Commit 8a4cc1a1 authored by azul's avatar azul

Merge branch '295-improve-bugfix' into 'master'

Fix: no nil values in group list - improve queries

Closes #295

See merge request !283
parents 558d53ee 44d27db4
...@@ -55,11 +55,11 @@ module Group::Groups ...@@ -55,11 +55,11 @@ module Group::Groups
# returns an array of committee ids given an array of group ids. # returns an array of committee ids given an array of group ids.
def committee_ids(ids) def committee_ids(ids)
Group.where(parent_id: ids).pluck(:id) Group.where.not(parent_id: nil).where(parent_id: ids).pluck(:id)
end end
def parent_ids(ids) def parent_ids(ids)
Group.where(id: ids).pluck(:parent_id).compact Group.where(id: ids).where.not(parent_id: nil).pluck(:parent_id)
end end
def can_have_committees? 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