6ecf819f73
This is tricky: the query was being run in `ObjectStorage::Extension::RecordsUploads#retrieve_from_store!`, but we can't just add batch loading there, because the `#upload=` method there would use the result immediately, making the batch only have one item. Instead, we can pre-emptively add an item to the batch whenever an avatarable object is initialized, and then reuse that batch item in `#retrieve_from_store!`. However, this also has problems: 1. There is a lot of logic in `Avatarable#retrieve_upload_from_batch`. 2. Some of that logic constructs a 'fake' model for the batch key. This should be fine, because of ActiveRecord's override of `#==`, but it relies on that staying the same. |
||
---|---|---|
.. | ||
attachment_uploader.rb | ||
avatar_uploader.rb | ||
file_mover.rb | ||
file_uploader.rb | ||
gitlab_uploader.rb | ||
job_artifact_uploader.rb | ||
legacy_artifact_uploader.rb | ||
lfs_object_uploader.rb | ||
namespace_file_uploader.rb | ||
object_storage.rb | ||
personal_file_uploader.rb | ||
records_uploads.rb | ||
uploader_helper.rb | ||
workhorse.rb |