You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
After updating a pretty old project to Ecto 3.4 and Elixir 1.7, I found I had a whole bunch of failing tests anywhere where I was not overriding ja_resource's handle_delete. The reason was this line.
This was resulting in my controllers returning 422's where 204's were expected due to the record not passing validation (which is part of the changeset function in most cases). I haven't figured out why this changed in my upgrade, but regardless, I wanted to understand why this line is there.
If you are going to delete a record, what is the use in building a changeset from it first? And if it gets marked invalid in that process (for example if the record were created before you added some stricter validations later on), why should that prevent a delete?
I'm going to fork and remove this for now, but I am probably missing something so I would love to discuss if anyone has thoughts on this!
The text was updated successfully, but these errors were encountered:
After updating a pretty old project to Ecto 3.4 and Elixir 1.7, I found I had a whole bunch of failing tests anywhere where I was not overriding ja_resource's handle_delete. The reason was this line.
ja_resource/lib/ja_resource/delete.ex
Line 51 in 1035b86
This was resulting in my controllers returning 422's where 204's were expected due to the record not passing validation (which is part of the changeset function in most cases). I haven't figured out why this changed in my upgrade, but regardless, I wanted to understand why this line is there.
If you are going to delete a record, what is the use in building a changeset from it first? And if it gets marked invalid in that process (for example if the record were created before you added some stricter validations later on), why should that prevent a delete?
I'm going to fork and remove this for now, but I am probably missing something so I would love to discuss if anyone has thoughts on this!
The text was updated successfully, but these errors were encountered: