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 riseuplabs/crabgrass!283
parents 558d53ee 44d27db4
......@@ -55,11 +55,11 @@ module Group::Groups
# returns an array of committee ids given an array of group ids.
def committee_ids(ids)
Group.where(parent_id: ids).pluck(:id)
Group.where.not(parent_id: nil).where(parent_id: ids).pluck(:id)
def parent_ids(ids)
Group.where(id: ids).pluck(:parent_id).compact
Group.where(id: ids).where.not(parent_id: nil).pluck(:parent_id)
def can_have_committees?
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment