summaryrefslogtreecommitdiff
path: root/db/seeds.rb
diff options
context:
space:
mode:
authorDavid Gay <david@davidgay.org>2021-05-23 20:15:03 -0400
committerDavid Gay <david@davidgay.org>2021-05-23 20:15:03 -0400
commit82eec1f68172857b3b39e6ab3e3b837de16c1198 (patch)
treea1edb49f55ad01c3acaf41070bf09f207fcfaf22 /db/seeds.rb
parent6bf84733db22f6c5d5105acc3565b075fcc65917 (diff)
Item usage
Diffstat (limited to 'db/seeds.rb')
-rw-r--r--db/seeds.rb5
1 files changed, 1 insertions, 4 deletions
diff --git a/db/seeds.rb b/db/seeds.rb
index 5a6c696..a1459cc 100644
--- a/db/seeds.rb
+++ b/db/seeds.rb
@@ -27,10 +27,7 @@ end
load_data_file("data/items.yml").map do |gid, hash|
item = Item.find_or_create_by(gid: gid)
- item.assign_attributes(hash.except(:equip_slot, :usable))
- item.equip_slot = hash[:equip_slot]&.to_sym
- item.usable = hash[:usable] || false
- item.save
+ item.update(hash)
end
load_data_file("data/locations.yml").map do |gid, hash|