Database seeding
This commit is contained in:
40
db/seeds.rb
40
db/seeds.rb
@@ -7,3 +7,43 @@
|
||||
# ["Action", "Comedy", "Drama", "Horror"].each do |genre_name|
|
||||
# MovieGenre.find_or_create_by!(name: genre_name)
|
||||
# end
|
||||
# db/seeds.rb
|
||||
|
||||
Task.destroy_all
|
||||
Project.destroy_all
|
||||
|
||||
project1 = Project.create!(
|
||||
project_name: "project one",
|
||||
description: "This is project one"
|
||||
)
|
||||
|
||||
project2 = Project.create!(
|
||||
project_name: "project two",
|
||||
description: "This is project two"
|
||||
)
|
||||
|
||||
Task.create!(
|
||||
title: "first task of project one",
|
||||
status: :to_do,
|
||||
project: project1
|
||||
)
|
||||
|
||||
Task.create!(
|
||||
title: "second task of project one",
|
||||
status: :in_progress,
|
||||
project: project1
|
||||
)
|
||||
|
||||
Task.create!(
|
||||
title: "third task of project one",
|
||||
status: :done,
|
||||
project: project1
|
||||
)
|
||||
|
||||
Task.create!(
|
||||
title: "first task of project two",
|
||||
status: :to_do,
|
||||
project: project2
|
||||
)
|
||||
|
||||
puts "Seeding complete"
|
||||
Reference in New Issue
Block a user