forked from shibao/cannery
add types to ecto changeset specs
This commit is contained in:
@ -47,7 +47,7 @@ defmodule Cannery.Ammo.AmmoGroup do
|
||||
@type id :: UUID.t()
|
||||
|
||||
@doc false
|
||||
@spec changeset(t() | new_ammo_group(), attrs :: map()) :: Changeset.t()
|
||||
@spec changeset(t() | new_ammo_group(), attrs :: map()) :: Changeset.t(t() | new_ammo_group())
|
||||
def changeset(ammo_group, attrs) do
|
||||
ammo_group
|
||||
|> cast(attrs, [:count, :price_paid, :notes, :tag_id, :ammo_type_id, :container_id, :user_id])
|
||||
|
@ -38,7 +38,7 @@ defmodule Cannery.Ammo.AmmoType do
|
||||
@type id :: UUID.t()
|
||||
|
||||
@doc false
|
||||
@spec changeset(t() | new_ammo_type(), attrs :: map()) :: Changeset.t()
|
||||
@spec changeset(t() | new_ammo_type(), attrs :: map()) :: Changeset.t(t() | new_ammo_type())
|
||||
def changeset(ammo_type, attrs) do
|
||||
ammo_type
|
||||
|> cast(attrs, [:name, :desc, :case_material, :bullet_type, :grain, :manufacturer])
|
||||
|
Reference in New Issue
Block a user