stavro/arc_ecto

ProjectName.Avatar.Type causes Plug.conn bug?

wilfredkun opened this issue · 1 comments

I have arc and arc ecto up and running. I can upload files just fine.

However after a file is uploaded the controller always redirects to the initial page which the file was sent from.

I have tried to identify the source of the issue and it appears that the defining of a changeset causes the issue but no errors raised which makes it hard to determine what needs to be fixed.

e.g.

Model

schema "images" do
field :name, :string
field :avatar, BlogPhoenix.Avatar.Type
field :identifier, :string
end
....

Controller

image_params = {%Plug.Upload{....}

changeset = Image.changeset(%Image{}, Map.put(image_params, "identifier", random_number))

If I remove the image_params it can redirect the conn just fine.

e.g.
changeset = Image.changeset(%Image{}, %{random: "stuff")
^ This would cause a changeset issue but the conn can be manipulated normally.

Does anyone else experience this issue when calling the changeset?

Turns out code reloading was stopping the redirects.