     }
   end
 
-  defp message(opts, key \\ :message, default) do
+  defp message(opts, key, default) do
     Keyword.get(opts, key, default)
   end
 end


  Also it will run embed run child changeset as `cast_embed` would do.
  """
  def cast_dynamic_embed(changeset, field, opts \\ []) do
    case Ecto.Changeset.get_change(changeset, field) do
      nil ->
        changeset
      change ->
        changeset
        |> resolve_embed_schema(field, change, opts)
        |> Ecto.Changeset.cast_embed(field)
    end
  end

  defp resolve_embed_schema(%{types: types} = changeset, field, change, opts) when is_map(change) do
    key = cast_key!(field)
    type = Map.get(types, key)

    |> Map.get(:__struct__)
    |> build_embed_type(schema, field, on_cast)

    %{changeset | changes: Map.put(changes, field, embed_changeset),
                  valid?: changeset.valid? and embed_changeset.valid?}#,
                  #types: Map.put(types, field, embed_type)}
  end

  defp build_embed_type(owner, schema, field, on_cast) do
    {:embed, %Ecto.Embedded{
        cardinality: :one, field: field,
        on_cast: on_cast,
        on_replace: :raise, owner: owner,
        related: schema, unique: true
      }
    }
  end

  defp build_embed_schema(schema, field, %{data: data}) when is_map(data) and not is_nil(data) do
