Only creates ballot when budget balloting

This commit is contained in:
kikito
2016-12-25 12:54:32 +01:00
parent 3fd1993f74
commit ef0acaf20f

View File

@@ -84,7 +84,8 @@ module Budgets
end
def load_ballot
@ballot = Budget::Ballot.where(user: current_user, budget: @budget).first_or_create
query = Budget::Ballot.where(user: current_user, budget: @budget)
@ballot = @budget.balloting? ? query.first_or_create : query.first_or_initialize
end
def load_heading