I created this module:
defmodule Discuss.Topic do
user Discuss.Web, :model
schema "topics" do
field :title, :string
end
def changeset(struct, params \\ %{}) do
struct
|> cast(params, [:title])
|> validate_required([:title])
end
end
and I got this error when using mix phoenix.server
== Compilation error in file web/models/topic.ex ==
** (CompileError) web/models/topic.ex:2: undefined function user/2
(stdlib) erl_eval.erl:680: :erl_eval.do_apply/6
(elixir) lib/kernel/parallel_compiler.ex:229: anonymous fn/4 in Kernel.ParallelCompiler.spawn_workers/7
Any idea of what's happening? I'm new to Phoenix and Elixir.