Added authentication_zero
This commit is contained in:
24
db/seeds.rb
24
db/seeds.rb
@@ -10,28 +10,28 @@
|
||||
|
||||
Faker::Config.locale = :de
|
||||
|
||||
10.times do
|
||||
User.new(firstname: Faker::Name.unique.first_name, lastname: Faker::Name.unique.last_name).save
|
||||
# Admin
|
||||
User.create!(email: "david.boehm@hs-rm.de", firstname: "David", lastname: "Böhm", role: :admin, password_digest: BCrypt::Password.create("admin"), verified: true)
|
||||
|
||||
# Students
|
||||
students = []
|
||||
5.times do
|
||||
firstname = Faker::Name.unique.first_name
|
||||
lastname = Faker::Name.unique.last_name
|
||||
students << User.new(email: firstname + "." + lastname + "@student.hs-rm.de", firstname: firstname, lastname: lastname, password_digest: BCrypt::Password.create("password"), verified: true)
|
||||
students.last.save!
|
||||
end
|
||||
|
||||
[ 'GanzWichtig.pdf', 'IchBinIn5MinDran.pdf', 'DerPlanDerImmerProblemeMacht.pdf',
|
||||
'DieFarbenGefallenMirNicht.pdf', 'MachHinIchHabsEilig.pdf', 'WarumDauertDasSoLange.pdf',
|
||||
'DenPlanBezahleIchNicht.pdf', 'IchWarAlsErstesDran.pdf', 'WarumIstDerPlotterDefekt.pdf',
|
||||
'DasNächsteMalGeheIchWoAndersHin.pdf' ].shuffle.each do |pdf|
|
||||
# a0 = rand(0...7)
|
||||
# a1 = rand(0...7)
|
||||
# a2 = rand(0...7)
|
||||
# a3 = rand(0...7)
|
||||
# a0.zero? || a1 = 0 && a2 = 0 && a3 = 0
|
||||
# a1.zero? || a2 = 0 && a3 = 0
|
||||
# a2.zero? || a3 = 0
|
||||
status = %i[open open open open open
|
||||
printing pickup paid canceled].sample
|
||||
status = %i[open open open open open printing pickup paid canceled].sample
|
||||
|
||||
job = Job.new(costumer_firstname: Faker::Name.unique.first_name, costumer_lastname: Faker::Name.unique.last_name,
|
||||
costumer_id: students[rand(0...4)].id,
|
||||
# number_of_plans_a0: a0, number_of_plans_a1: a1, number_of_plans_a2: a2, number_of_plans_a3: a3,
|
||||
status:, privacy_policy_accepted: true)
|
||||
job.pdf = File.open(Rails.root.join('db/pdfs/', pdf))
|
||||
job.save!
|
||||
# sleep 1 # for testing broadcasting
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user