It's Riseup's twentieth year, help keep us going! If you can afford it, please contribute to our winter fundraising drive.

Commit 44d27db4 authored by dgt's avatar dgt

Fix: no nil values in group list - improve queries

parent 558d53ee
......@@ -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)
end
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
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