take naming categories from game

This commit is contained in:
2021-09-28 15:37:52 +02:00
parent 4ce73af7e4
commit 5825c0b09f
2 changed files with 195 additions and 195 deletions
+2 -2
View File
@@ -5,7 +5,7 @@ defmodule PokemonCouture.Shops.Clothes do
schema "clothes" do
field :name, :string
field :color, :string
field :type, :string # shirt, pants, socks, shoes, bag, hat, glasses, accessory
field :type, :string # shirt, bottoms, socks, shoes, bag, hat, eyewear, hair accessory
field :game, :string
field :location, :string
many_to_many :users, PokemonCouture.Accounts.User, join_through: "ownerships", unique: :true, on_replace: :delete
@@ -18,6 +18,6 @@ defmodule PokemonCouture.Shops.Clothes do
clothes
|> cast(attrs, [:name, :location, :type, :game, :color])
|> validate_required([:name, :location, :type, :game, :color])
|> validate_format(:type, ~r/(shirt)|(pants)|(socks)|(shoes)|(bag)|(hat)|(glasses)|(accessory)/)
|> validate_format(:type, ~r/(shirt)|(bottoms)|(socks)|(shoes)|(bag)|(hat)|(eyewear)|(hair accessory)/)
end
end