Add logic to show only winner investments if budget is finished
Backported from AyuntamientoMadrid/consul
This commit is contained in:
@@ -32,7 +32,11 @@ module Budgets
|
||||
respond_to :html, :js
|
||||
|
||||
def index
|
||||
@investments = investments.page(params[:page]).per(10).for_render
|
||||
if @budget.finished?
|
||||
@investments = investments.winners.page(params[:page]).per(10).for_render
|
||||
else
|
||||
@investments = investments.page(params[:page]).per(10).for_render
|
||||
end
|
||||
|
||||
@investment_ids = @investments.pluck(:id)
|
||||
load_investment_votes(@investments)
|
||||
|
||||
Reference in New Issue
Block a user