Use Case: In my ecto model :profile_picture is an optionalExfile.Ecto.File field.
When I call the below changeset function with profile_picture not being set exfile raises an no function clause matching in Exfile.Backend.FileSystem.upload/2 error when calling Exfile.Ecto.prepare_uploads([:profile_picture]). This pull request fixes the problem.
def changeset(%Person{} = person attrs) do
person
|> cast(attrs, [:lastname, :firstname, :profile_picture, :birthday, :parents, :street, :postal_code, :town, :phone1_label, :phone1, :phone2_label, :phone2, :phone3_label, :phone3, :mail1, :mail2, :group_id])
|> validate_required([:lastname, :firstname])
|> validate_content_type(:profile_picture, :image)
|> Exfile.Ecto.prepare_uploads([:profile_picture])
end
Use Case: In my ecto model
:profile_picture
is an optionalExfile.Ecto.File
field.When I call the below changeset function with profile_picture not being set exfile raises an
no function clause matching in Exfile.Backend.FileSystem.upload/2
error when callingExfile.Ecto.prepare_uploads([:profile_picture])
. This pull request fixes the problem.