This fixes the current dialyzer error, but also cleans up the API and removes the need for cast_attachments/4 to be a macro.
With this new API, one can access the current behaviour with:
defmodule TestUser do
use Ecto.Schema
import Ecto.Changeset
import Arc.Ecto.Changeset
schema "users" do
field :first_name, :string
field :avatar, DummyDefinition.Type
end
def changeset(struct, params) do
struct
|> cast(params, ~w(first_name)a)
|> cast_attachments(params, ~w(avatar)a)
end
end
This, in my mind, makes more sense as we are trying to access a changeset function.
With breaking changes, this would require a version bump.
If this PR is something of interest, I can also update the documentation.
This fixes the current dialyzer error, but also cleans up the API and removes the need for
cast_attachments/4
to be a macro.With this new API, one can access the current behaviour with:
This, in my mind, makes more sense as we are trying to access a changeset function.
With breaking changes, this would require a version bump.
If this PR is something of interest, I can also update the documentation.
Related to #109 and #106