diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2019-11-08 15:06:21 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2019-11-08 15:06:21 +0000 |
commit | 759bab058520a21d87087355dc193f634176e98a (patch) | |
tree | c26bdab0be782b6852e5f588dc5f1b056c2eec56 /app/models/lfs_object.rb | |
parent | 61f0c58946ebac453b55a657cd4be1ac50a01e11 (diff) | |
download | gitlab-ce-759bab058520a21d87087355dc193f634176e98a.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/models/lfs_object.rb')
-rw-r--r-- | app/models/lfs_object.rb | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/app/models/lfs_object.rb b/app/models/lfs_object.rb index 535c3cf2ba1..48c971194c6 100644 --- a/app/models/lfs_object.rb +++ b/app/models/lfs_object.rb @@ -18,6 +18,11 @@ class LfsObject < ApplicationRecord after_save :update_file_store, if: :saved_change_to_file? + def self.not_linked_to_project(project) + where('NOT EXISTS (?)', + project.lfs_objects_projects.select(1).where('lfs_objects_projects.lfs_object_id = lfs_objects.id')) + end + def update_file_store # The file.object_store is set during `uploader.store!` # which happens after object is inserted/updated |