defmodule Core.Question do
  use Core.Web, :model

  schema "questions" do
    field :title, :string

    many_to_many :question_tags, Core.Tag, join_through: Core.QuestionTag

    timestamps()
  end

  @doc """
  Builds a changeset based on the `struct` and `params`.
  """
  def changeset(struct, params \\ %{}) do
    struct
    |> cast(params, [:title])
    |> validate_required([:title])
  end
end

defmodule Core.Question do
  use Core.Web, :model

  schema "questions" do
    field :title, :string
    field :tags, {:array, :map}, virtual: true

    many_to_many :question_tags, Core.Tag, join_through: Core.QuestionTag

    timestamps()
  end

  @doc """
  Builds a changeset based on the `struct` and `params`.
  """
  def changeset(struct, params \\ %{}) do
    struct
    |> cast(params, [:title, :tags])
    |> validate_required([:title, :tags])
  end
end

Add "tags" field to Core.Question
Add "tags" field to Core.Question

exacs/liqen-core,exacs/liqen-core