StrawHat.Map v0.3.0 StrawHat.Map.Schema.City View Source

Represents a City Ecto Schema with functionality about the data validation for City.

Link to this section Summary

Types

Check t/0 type for more information about the keys

t()

Functions

Validate the attributes and return a Ecto.Changeset for the current City

Link to this section Types

Link to this type city_attrs() View Source
city_attrs() :: %{
  name: String.t(),
  capital: boolean(),
  state_id: Integer.t(),
  county_id: Integer.t()
}

Check t/0 type for more information about the keys.

Link to this type t() View Source
t() :: %StrawHat.Map.Schema.City{
  __meta__: term(),
  addresses: [StrawHat.Map.Schema.Address.t()],
  capital: boolean(),
  county: StrawHat.Map.Schema.County.t() | Ecto.Association.NotLoaded.t(),
  county_id: Integer.t(),
  id: term(),
  name: String.t(),
  state: StrawHat.Map.Schema.State.t() | Ecto.Association.NotLoaded.t(),
  state_id: Integer.t()
}

Link to this section Functions

Link to this function changeset(city, city_attrs) View Source
changeset(t(), city_attrs()) :: Ecto.Changeset.t()

Validate the attributes and return a Ecto.Changeset for the current City.