add db/seeds.rb and fix saving Player.paid

This commit is contained in:
Ben Harris 2022-01-31 18:38:22 -05:00
parent 7d92091c27
commit 30b5032b3c
2 changed files with 25 additions and 1 deletions

View File

@ -6,6 +6,6 @@ class Player < ApplicationRecord
private
def default_values
self.strikes ||= 0
self.paid ||= true
self.paid = self.paid.nil? ? true : self.paid
end
end

View File

@ -6,3 +6,27 @@
#
# movies = Movie.create([{ name: "Star Wars" }, { name: "Lord of the Rings" }])
# Character.create(name: "Luke", movie: movies.first)
machines = [
["Avengers: Infinity Quest", "Pro"],
["Deadpool", "Pro"],
["Elvira and the Party Monsters", "Pro"],
["Family Guy", "Pro"],
["Godzilla", "Pro"],
["Goldeneye", "Pro"],
["Iron Maiden", "Pro"],
["Jurassic Park", "Pro"],
["Led Zeppelin", "Pro"],
["Mandalorian", "Pro"],
["Metallica", "Pro"],
["Monster Bash", "Remake"],
["Star Wars", "Pro"],
["Stranger Things", "Pro"],
["Teenage Mutant Ninja Turtles", "Pro"],
["The Beatles", "Gold"],
["The Sopranos", "Pro"],
]
machines.each do |name, edition|
Machine.create(name: name, edition: edition)
end