Skip to content

Commit cdee27f

Browse files
committed
Refactor project allocation display logic to filter out nil project URLs and unsuccessful allocations in a single line
1 parent a77a7c3 commit cdee27f

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

app/views/funds/show.html.erb

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -173,9 +173,7 @@
173173
</tr>
174174
</thead>
175175
<tbody>
176-
<% @project_allocations.each_with_index do |project_allocation, i| %>
177-
<% next if project_allocation.project_url.nil? %>
178-
<% next if @allocation.completed? && !project_allocation.success? %>
176+
<% @project_allocations.reject{|pa| pa.project_url.nil? || @allocation.completed? && !pa.success? }.each_with_index do |project_allocation, i| %>
179177

180178
<!-- Main Row -->
181179
<tr class="clickable-row <%= 'row-rejected' if project_allocation.project_funding_rejected %>" data-bs-toggle="collapse" data-bs-target="#details-<%= i %>" role="button" aria-controls="#details-<%= i %>">

0 commit comments

Comments
 (0)