Merge pull request #2622 from consul/selected-investments-map

Adds message to selected budget investments
This commit is contained in:
Alberto
2018-06-06 19:21:24 +02:00
committed by GitHub
3 changed files with 82 additions and 1 deletions

View File

@@ -66,7 +66,13 @@ module BudgetsHelper
def current_budget_map_locations
return unless current_budget.present?
MapLocation.where(investment_id: current_budget.investments).map { |l| l.json_data }
if current_budget.valuating_or_later?
investments = current_budget.investments.selected
else
investments = current_budget.investments
end
MapLocation.where(investment_id: investments).map { |l| l.json_data }
end
def display_calculate_winners_button?(budget)

View File

@@ -105,6 +105,10 @@ class Budget < ActiveRecord::Base
Budget::Phase::PUBLISHED_PRICES_PHASES.include?(phase)
end
def valuating_or_later?
valuating? || publishing_prices? || balloting_or_later?
end
def balloting_process?
balloting? || reviewing_ballots?
end