Prevent a division by zero from happening on sort by random investment scope

This commit is contained in:
Bertocq
2017-11-28 22:32:30 +01:00
parent 3984d6a947
commit c5fa85e3f6
2 changed files with 2 additions and 2 deletions

View File

@@ -94,7 +94,7 @@ module Budgets
def set_random_seed
if params[:order] == 'random' || params[:order].blank?
seed = rand(10..99) / 10.0
seed = rand(11..99) / 10.0
params[:random_seed] ||= Float(seed) rescue 0
else
params[:random_seed] = nil