from(f in Friendship, where: f.type == :friend) |> Repo.all()
I receive the following error:
iex(2)> from(f in Friendship, where: f.type == :friend) |> Repo.all()
** (Ecto.Query.CompileError) `:friend` is not a valid query expression
(ecto) expanding macro: Ecto.Query.where/3
iex:2: (file)
(ecto) expanding macro: Ecto.Query.from/2
iex:2: (file)
(elixir) expanding macro: Kernel.|>/2
iex:2: (file)
friendship.ex:
defmodule Eclipse.Friendship do
use Eclipse.Web, :model
import EctoEnum
defenum FriendshipTypeEnum, friend: 0, blocked: 1
schema "friendships" do
field :type, FriendshipTypeEnum
...
end
...
end
Given:
I receive the following error:
friendship.ex: