about summary refs log tree commit diff
diff options
context:
space:
mode:
authorBen Harris <ben@tilde.team>2022-01-31 18:38:22 -0500
committerBen Harris <ben@tilde.team>2022-01-31 18:38:22 -0500
commit30b5032b3c9de489ebc90097ae0b04a590b43be5 (patch)
tree84700f4c36f1fc112726fbb730e94a55b0a6da72
parent7d92091c278428de7b9bacd76d95a460200b8638 (diff)
add db/seeds.rb and fix saving Player.paid
-rw-r--r--app/models/player.rb2
-rw-r--r--db/seeds.rb24
2 files changed, 25 insertions, 1 deletions
diff --git a/app/models/player.rb b/app/models/player.rb
index 7032197..9fcf3a4 100644
--- a/app/models/player.rb
+++ b/app/models/player.rb
@@ -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
diff --git a/db/seeds.rb b/db/seeds.rb
index 0664d1b..2db5b60 100644
--- a/db/seeds.rb
+++ b/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