take naming categories from game
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user