Adding a stable way of adding whitelisted "orphaned" uploads in a plugin

This is so clunky

https://github.com/discourse/discourse/blob/32b8a2ccffd50d78b8f7be6f0b524506cd2dbd7e/app/jobs/scheduled/clean_up_uploads.rb#L53-L66

For reviewables @eviltrout introduced a general mechanism where arbitrary objects could be linked to a reviewable.

Moving to a similar system for uploads would be like moving multiple mountains. It would be a nice mountain to move though cause this current system is pretty fragile.

Easiest workaround you have for now is to create a hidden site setting with a data_type for :upload. Then put it in the site settings table.

8 Likes