Skip to content

Commit

Permalink
add some seed users & lectures (#129)
Browse files Browse the repository at this point in the history
* 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 <[email protected]>
  • Loading branch information
2 people authored and mergify[bot] committed Jan 16, 2020
1 parent c9b18fc commit e7470a4
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions db/seeds.rb
Original file line number Diff line number Diff line change
@@ -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: "[email protected]", password: "1234567890", password_confirmation: "1234567890")

lecturer_1 = User.create(is_student: false, email: "[email protected]", password: "1234567890", password_confirmation: "1234567890")
User.create(is_student: true, email: "[email protected]", password: "1234567890", password_confirmation: "1234567890")
User.create(is_student: true, email: "[email protected]", password: "1234567890", password_confirmation: "1234567890")

course_1 = Course.create(name: "<Kurs-1>", description: "Testkurs #1", creator: lecturer_1)

Lecture.create(name: "<Created Lecture>", 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: "<Running Lecture>", 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: "<Ended Lecture>", 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")

0 comments on commit e7470a4

Please sign in to comment.