From e7470a42bb0700220e9560eecbabee3199bf3d83 Mon Sep 17 00:00:00 2001 From: Adrian Jost <22987140+adrianjost@users.noreply.github.com> Date: Thu, 16 Jan 2020 13:23:16 +0000 Subject: [PATCH] add some seed users & lectures (#129) * add some seed users & lectures * remove unused var * adapt seed data to have a course * Adjust seed data to new DB Schema of lectures Co-authored-by: Lasse Jahn --- db/seeds.rb | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/db/seeds.rb b/db/seeds.rb index 88ab1cfe..029156e2 100755 --- a/db/seeds.rb +++ b/db/seeds.rb @@ -1,9 +1,12 @@ # This file should contain all the record creation needed to seed the database with its default values. # The data can then be loaded with the rails db:seed command (or created alongside the database with db:setup). - # - # Examples: - # - # movies = Movie.create([{ name: 'Star Wars' }, { name: 'Lord of the Rings' }]) - # Character.create(name: 'Luke', movie: movies.first) - Lecture.create(name: "swt", enrollment_key: "epic", status: "created") - User.create(email: "user@example.com", password: "1234567890", password_confirmation: "1234567890") + + lecturer_1 = User.create(is_student: false, email: "lecturer-1@hpi.de", password: "1234567890", password_confirmation: "1234567890") + User.create(is_student: true, email: "student-1@hpi.de", password: "1234567890", password_confirmation: "1234567890") + User.create(is_student: true, email: "student-2@hpi.de", password: "1234567890", password_confirmation: "1234567890") + + course_1 = Course.create(name: "", description: "Testkurs #1", creator: lecturer_1) + + Lecture.create(name: "", enrollment_key: "epic", status: "created", lecturer: lecturer_1, course: course_1, date: "2019-12-31", start_time: "2019-12-31 23:59:00", end_time: "2020-01-01 00:01:00") + Lecture.create(name: "", enrollment_key: "epic", status: "running", lecturer: lecturer_1, course: course_1, date: "2019-12-31", start_time: "2019-12-31 23:59:00", end_time: "2020-01-01 00:01:00") + Lecture.create(name: "", enrollment_key: "epic", status: "ended", lecturer: lecturer_1, course: course_1, date: "2019-12-31", start_time: "2019-12-31 23:59:00", end_time: "2020-01-01 00:01:00")