add db/seeds.rb and fix saving Player.paid
This commit is contained in:
parent
7d92091c27
commit
30b5032b3c
|
@ -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
|
||||
|
|
24
db/seeds.rb
24
db/seeds.rb
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue