Hide headings with no investments

The page should not show any headings which don't have any
winning investments. The "no content" message should only be
shown when there are no headings with investments to avoid an
otherwise blank page.

__Note:__ in the main @headings query, _both_ #includes and #joins
are needed to:
 1. eager load all necessary data (#includes)
and
 2. to perform an INNER JOIN on milestones to filter out investments
with no milestones (#joins).
This commit is contained in:
Marko Lovic
2018-07-20 12:43:36 +02:00
committed by Javi Martín
parent a3ef662509
commit 8376efce3f
7 changed files with 48 additions and 43 deletions

View File

@@ -62,6 +62,12 @@
</div>
<% end %>
<%= render 'budgets/executions/investments' %>
<% if @headings.any? %>
<%= render 'budgets/executions/investments' %>
<% else %>
<div class="callout primary clear">
<%= t("budgets.executions.no_winner_investments") %>
</div>
<% end %>
</div>
</div>