Add Milestone tag select filter on executions public page
This commit is contained in:
@@ -12,15 +12,15 @@ module Budgets
|
||||
|
||||
private
|
||||
def investments_by_heading
|
||||
base = @budget.investments.winners
|
||||
base = base.joins(milestones: :translations).includes(:milestones)
|
||||
base = base.tagged_with(params[:milestone_tag]) if params[:milestone_tag].present?
|
||||
|
||||
if params[:status].present?
|
||||
@budget.investments.winners
|
||||
.with_milestone_status_id(params[:status])
|
||||
.uniq
|
||||
.group_by(&:heading)
|
||||
base = base.with_milestone_status_id(params[:status])
|
||||
base.uniq.group_by(&:heading)
|
||||
else
|
||||
@budget.investments.winners
|
||||
.joins(milestones: :translations)
|
||||
.distinct.group_by(&:heading)
|
||||
base.distinct.group_by(&:heading)
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user