summaryrefslogtreecommitdiff
path: root/app/models
diff options
context:
space:
mode:
authorAlessio Caiazza <acaiazza@gitlab.com>2018-03-23 11:07:22 +0100
committerAlessio Caiazza <acaiazza@gitlab.com>2018-03-27 10:32:48 +0200
commit04c5e637f827d869f8bbfb21ca41eb552c3324d6 (patch)
tree72c21a6a623dba819cfbcdd45a25d43832b27124 /app/models
parentffa73498b1c3125eec6d51db4502ab22da664773 (diff)
downloadgitlab-ce-04c5e637f827d869f8bbfb21ca41eb552c3324d6.tar.gz
Port LFS direct_upload from EEac/lfs-direct-upload-ee-to-ce
Diffstat (limited to 'app/models')
-rw-r--r--app/models/lfs_object.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/app/models/lfs_object.rb b/app/models/lfs_object.rb
index 64e88d5a6a2..b7de46fa202 100644
--- a/app/models/lfs_object.rb
+++ b/app/models/lfs_object.rb
@@ -11,6 +11,12 @@ class LfsObject < ActiveRecord::Base
mount_uploader :file, LfsObjectUploader
+ before_save :update_file_store
+
+ def update_file_store
+ self.file_store = file.object_store
+ end
+
def project_allowed_access?(project)
projects.exists?(project.lfs_storage_project.id)
end