Skip to content

Commit

Permalink
[rubyforgood#3052] Fix family request confirmation after rebasing wrt r…
Browse files Browse the repository at this point in the history
  • Loading branch information
danielabar committed Jul 27, 2024
1 parent d2518cc commit 0e015b0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions app/controllers/partners/family_requests_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,9 @@ def validate
end
end

children = current_partner.children.active.where(id: children_ids).where.not(item_needed_diaperid: [nil, 0])
children = current_partner.children.active.where(id: children_ids).joins(:requested_items).select('children.*', :item_id)

children_grouped_by_item_id = children.group_by(&:item_needed_diaperid)
children_grouped_by_item_id = children.group_by(&:item_id)
family_requests_attributes = children_grouped_by_item_id.map do |item_id, item_requested_children|
{ item_id: item_id, person_count: item_requested_children.size, children: item_requested_children }
end
Expand Down

0 comments on commit 0e015b0

Please sign in to comment.