Database seeding

This commit is contained in:
KaungKaung
2026-01-27 10:18:48 +06:30
parent f72af5d45f
commit fd0a6fb408

View File

@@ -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"