Merge pull request #2622 from consul/selected-investments-map
Adds message to selected budget investments
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user