carrierwaveuploader / carrierwave

Classier solution for file uploads for Rails, Sinatra and other Ruby web frameworks
https://github.com/carrierwaveuploader/carrierwave
8.78k stars 1.66k forks source link

Delete a file in 3.0.0.beta - Breaking change #2654

Closed Drnoodle closed 1 year ago

Drnoodle commented 1 year ago

Hello 👋 In carrierwave 2.2.2 I was able to delete my file using update!(myfile: nil). After updating carrierwave to 3.0.0.beta I have to use update!(remove_myfile: true) to delete my file. I don't see this breaking change in the changelog. I'm currently hesitating to downgrade carrierwave to 2.2.x and wait for the next release before refactoring my code. Let me know if you plan to keep the breaking change. 👍 Hugo

mshibuya commented 1 year ago

It was a side effect of #2613. Now fixed in the master. But I consider this behavior of allowing file deletion by nil assignment is an accidental one brought by https://github.com/carrierwaveuploader/carrierwave/commit/67800fdeb796a7b2efe1192e06f619dcc3c64f05, not a part of public API design. I don't recommend relying on this.

Drnoodle commented 1 year ago

Thx!