From a6a53659ae0ec01fa85df9c9050a271e55384ae2 Mon Sep 17 00:00:00 2001 From: rgarcia Date: Fri, 9 Sep 2016 15:44:04 +0200 Subject: [PATCH] updates dev seeds --- db/dev_seeds.rb | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/db/dev_seeds.rb b/db/dev_seeds.rb index 16be19f67..f3de46d3b 100644 --- a/db/dev_seeds.rb +++ b/db/dev_seeds.rb @@ -298,11 +298,12 @@ end puts "Creating Budgets" -(1..10).each do |i| +phases = %w{on_hold accepting selecting balloting finished} +phases.each_with_index do |phase, i| budget = Budget.create!(name: (Date.today.year - 10 + i).to_s, description: "

#{Faker::Lorem.paragraphs.join('

')}

", currency_symbol: "€", - phase: %w{on_hold accepting selecting balloting finished}.sample, + phase: phase, valuating: [false, true].sample) puts budget.name @@ -313,7 +314,7 @@ puts "Creating Budgets" geozones.each do |geozone| group.headings << group.headings.create!(name: geozone.name, geozone: geozone, - price: rand(1 .. 100) * 10000) + price: rand(1 .. 100) * 100000) end print "#{group.name} " @@ -324,7 +325,7 @@ end puts "Creating Investments" tags = Faker::Lorem.words(10) -(1..60).each do |i| +(1..100).each do |i| heading = Budget::Heading.reorder("RANDOM()").first investment = Budget::Investment.create!( @@ -340,7 +341,7 @@ tags = Faker::Lorem.words(10) unfeasibility_explanation: "

#{Faker::Lorem.paragraphs.join('

')}

", valuation_finished: [false, true].sample, tag_list: tags.sample(3).join(','), - price: rand(1 .. 100) * 1000000, + price: rand(1 .. 100) * 100000, terms_of_service: "1") puts " #{investment.title}" end