mirror of
https://github.com/ryankazokas/turbovault-app.git
synced 2026-04-16 23:22:53 +00:00
Adds types
This commit is contained in:
14
db/seeds.rb
14
db/seeds.rb
@@ -74,7 +74,7 @@ puts "Created #{Genre.count} genres"
|
||||
# Create demo user and sample games for development
|
||||
if Rails.env.development?
|
||||
puts "Creating demo user..."
|
||||
|
||||
|
||||
demo_user = User.find_or_create_by!(email: "demo@turbovault.com") do |user|
|
||||
user.username = "demo"
|
||||
user.password = "password123"
|
||||
@@ -94,24 +94,24 @@ if Rails.env.development?
|
||||
|
||||
# Create sample collections
|
||||
puts "Creating sample collections for demo user..."
|
||||
|
||||
|
||||
nintendo_collection = demo_user.collections.find_or_create_by!(name: "Nintendo Games") do |collection|
|
||||
collection.description = "All my Nintendo platform games"
|
||||
end
|
||||
|
||||
|
||||
n64_collection = demo_user.collections.find_or_create_by!(name: "N64 Classics") do |collection|
|
||||
collection.description = "Best games from the Nintendo 64 era"
|
||||
collection.parent_collection = nintendo_collection
|
||||
end
|
||||
|
||||
|
||||
favorites_collection = demo_user.collections.find_or_create_by!(name: "All-Time Favorites") do |collection|
|
||||
collection.description = "My absolute favorite games across all platforms"
|
||||
end
|
||||
|
||||
|
||||
backlog_collection = demo_user.collections.find_or_create_by!(name: "To Play") do |collection|
|
||||
collection.description = "Games I still need to complete"
|
||||
end
|
||||
|
||||
|
||||
puts " ✓ Created #{demo_user.collections.count} collections"
|
||||
|
||||
# Only create games if demo user has none
|
||||
@@ -314,7 +314,7 @@ if Rails.env.development?
|
||||
notes: game_data[:notes],
|
||||
date_added: game_data[:date_added] || Date.current
|
||||
)
|
||||
|
||||
|
||||
game.genres = game_data[:genres] if game_data[:genres]
|
||||
game.collections = game_data[:collections] if game_data[:collections]
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user