mirror of
https://github.com/ryankazokas/turbovault-app.git
synced 2026-04-16 23:22:53 +00:00
Moves seed genres to migration
This commit is contained in:
20
db/migrate/20260413115611_seed_genres.rb
Normal file
20
db/migrate/20260413115611_seed_genres.rb
Normal file
@@ -0,0 +1,20 @@
|
||||
class SeedGenres < ActiveRecord::Migration[8.1]
|
||||
def change
|
||||
# Create Genres
|
||||
puts "Creating genres..."
|
||||
genres = [
|
||||
"Action", "Adventure", "RPG", "JRPG", "Strategy", "Simulation",
|
||||
"Platformer", "Fighting", "Racing", "Sports", "Puzzle", "Horror",
|
||||
"Stealth", "Shooter", "FPS", "TPS", "Rhythm", "Visual Novel",
|
||||
"Roguelike", "Metroidvania", "Sandbox", "MMO", "Turn-Based",
|
||||
"Real-Time Strategy", "Tower Defense", "Card Game", "Party Game",
|
||||
"Educational", "Survival", "Battle Royale"
|
||||
]
|
||||
|
||||
genres.each do |genre_name|
|
||||
Genre.find_or_create_by!(name: genre_name)
|
||||
end
|
||||
|
||||
puts "Created #{Genre.count} genres"
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user