gitlab-ce/spec/support/shared_examples/models
Jan Provaznik 7da3b2cdd0 Delete remote uploads
ObjectStore uploader requires presence of associated `uploads` record
when deleting the upload file (through the carrierwave's after_commit
hook) because we keep info whether file is LOCAL or REMOTE in `upload`
object.

For this reason we can not destroy uploads as "dependent: :destroy" hook
because these would be deleted too soon. Instead we rely on
carrierwave's hook to destroy `uploads` in after_commit hook.

But in before_destroy hook we still have to delete not-mounted uploads
(which don't use carrierwave's destroy hook). This has to be done in
before_Destroy instead of after_commit because `FileUpload` requires
existence of model's object on destroy action.

This is not ideal state of things, in a next step we should investigate
how to unify model dependencies so we can use same workflow for all
uploads.

Related to #45425
2018-05-16 08:58:07 +02:00
..
atomic_internal_id_spec.rb Atomic internal ids for all models 2018-04-20 14:00:15 +00:00
cluster_application_core_shared_examples.rb Extend Cluster Applications to install GitLab Runner to Kubernetes cluster 2018-03-01 23:46:02 +00:00
cluster_application_status_shared_examples.rb Extend Cluster Applications to install GitLab Runner to Kubernetes cluster 2018-03-01 23:46:02 +00:00
issuable_hook_data_shared_examples.rb Introduce new hook data builders for Issue and MergeRequest 2017-10-09 16:44:47 +02:00
members_notifications_shared_example.rb Ensure member notifications are sent after the member actual creation/update in the DB 2018-04-26 08:28:05 +02:00
project_hook_data_shared_examples.rb
with_uploads_shared_examples.rb Delete remote uploads 2018-05-16 08:58:07 +02:00