Add db seeds

This commit is contained in:
riggraz
2019-08-24 13:35:01 +02:00
parent f0b3fe7a60
commit 651fa6e16d

View File

@@ -1,7 +1,16 @@
# 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)
# Create an admin user and confirm its email automatically
admin = User.create(email: "admin@example.com", password: "password", role: "admin", full_name: "Admin")
admin.confirm
# Create a board
board = Board.create(name: "Feature Requests")
# Create some post statuses
planned_post_status = PostStatus.create(name: "Planned", color: "#0096ff")
in_progress_post_status = PostStatus.create(name: "In Progress", color: "#9437ff")
completed_post_status = PostStatus.create(name: "Completed", color: "#6ac47c")
rejected_post_status = PostStatus.create(name: "Rejected", color: "#ff2600")
puts "A default admin user has been created. Credentials:"
puts "-> email: #{admin.email}"
puts "-> password: #{admin.password}"