mirror of
https://github.com/astuto/astuto.git
synced 2025-12-15 11:17:49 +01:00
Add db seeds
This commit is contained in:
23
db/seeds.rb
23
db/seeds.rb
@@ -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}"
|
||||
Reference in New Issue
Block a user