Added bigger pool for random seeds, now with a 9 * 10e-07 % of chance of appearing, also added test to cover edge cases (case in fact, the coincidence of the seeds it's correct)

Conflicts:
	app/controllers/budgets/investments_controller.rb
This commit is contained in:
Raúl Fuentes
2018-02-08 09:39:18 +01:00
parent ae25fdfc15
commit ebebbdf078
2 changed files with 24 additions and 4 deletions

View File

@@ -95,7 +95,7 @@ module Budgets
def set_random_seed
if params[:order] == 'random' || params[:order].blank?
seed = rand(-100..100) / 100.0
seed = params[:random_seed] || session[:random_seed] || rand(-100000..100000)
params[:random_seed] ||= Float(seed) rescue 0
else
params[:random_seed] = nil