# Defaults to type :string field :temp_lo, :integer field :temp_hi, :integer field :prcp, :float, default: 0.0 end end query = from w in Weather, where: w.prcp > 0 or is_nil(w.prcp), select: w Repo.all(query)
# Defaults to type :string field :temp_lo, :integer field :temp_hi, :integer field :prcp, :float, default: 0.0 end end query = from w in Weather, where: w.prcp > 0 or is_nil(w.prcp), select: w Repo.all(query)
# Defaults to type :string field :temp_lo, :integer field :temp_hi, :integer field :prcp, :float, default: 0.0 end end query = from w in Weather, where: w.prcp > 0 or is_nil(w.prcp), select: w Repo.all(query)
# Defaults to type :string field :temp_lo, :integer field :temp_hi, :integer field :prcp, :float, default: 0.0 end end query = from w in Weather, where: w.prcp > 0 or is_nil(w.prcp), select: w Repo.all(query)
# Defaults to type :string field :temp_lo, :integer field :temp_hi, :integer field :prcp, :float, default: 0.0 end end query = from w in Weather, where: w.prcp > 0 or is_nil(w.prcp), select: w Repo.all(query)
# Defaults to type :string field :temp_lo, :integer field :temp_hi, :integer field :prcp, :float, default: 0.0 end end query = from w in Weather, where: w.prcp > 0 or is_nil(w.prcp), select: w Repo.all(query)
- 10}) Repo.update!(%{bob | balance: bob.balance + 10}) end) post = Repo.get!(Post, 42) post = %{post | title: "New title"} case Repo.update post do {:ok, model} -> # Updated with success {:error, changeset} -> # Something went wrong end
- 10}) Repo.update!(%{bob | balance: bob.balance + 10}) end) post = Repo.get!(Post, 42) post = %{post | title: "New title"} case Repo.update post do {:ok, model} -> # Updated with success {:error, changeset} -> # Something went wrong end
- 10}) Repo.update!(%{bob | balance: bob.balance + 10}) end) post = Repo.get!(Post, 42) post = %{post | title: "New title"} case Repo.update post do {:ok, model} -> # Updated with success {:error, changeset} -> # Something went wrong end
field :name field :email field :age, :integer end def changeset(user, params \\ :empty) do user |> cast(params, ~w(name email), ~w(age)) |> validate_format(:email, ~r/@/) |> unique_constraint(:email) |> validate_inclusion(:age, 18..100) end end
field :name field :email field :age, :integer end def changeset(user, params \\ :empty) do user |> cast(params, ~w(name email), ~w(age)) |> validate_format(:email, ~r/@/) |> unique_constraint(:email) |> validate_inclusion(:age, 18..100) end end
field :name field :email field :age, :integer end def changeset(user, params \\ :empty) do user |> cast(params, ~w(name email), ~w(age)) |> validate_format(:email, ~r/@/) |> unique_constraint(:email) |> validate_inclusion(:age, 18..100) end end
field :name field :email field :age, :integer end def changeset(user, params \\ :empty) do user |> cast(params, ~w(name email), ~w(age)) |> validate_format(:email, ~r/@/) |> unique_constraint(:email) |> validate_inclusion(:age, 18..100) end end
field :name field :email field :age, :integer end def changeset(user, params \\ :empty) do user |> cast(params, ~w(name email), ~w(age)) |> validate_format(:email, ~r/@/) |> unique_constraint(:email) |> validate_inclusion(:age, 18..100) end end
field :name field :email field :age, :integer end def changeset(user, params \\ :empty) do user |> cast(params, ~w(name email), ~w(age)) |> validate_format(:email, ~r/@/) |> unique_constraint(:email) |> validate_inclusion(:age, 18..100) end end