diff options
Diffstat (limited to 'app/controllers/projects/lfs_storage_controller.rb')
-rw-r--r-- | app/controllers/projects/lfs_storage_controller.rb | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/app/controllers/projects/lfs_storage_controller.rb b/app/controllers/projects/lfs_storage_controller.rb index dd7e673ec75..930d9a05c50 100644 --- a/app/controllers/projects/lfs_storage_controller.rb +++ b/app/controllers/projects/lfs_storage_controller.rb @@ -56,6 +56,7 @@ class Projects::LfsStorageController < Projects::GitHttpClientController params[:size].to_i end + # rubocop: disable CodeReuse/ActiveRecord def store_file!(oid, size) object = LfsObject.find_by(oid: oid, size: size) unless object&.file&.exists? @@ -66,6 +67,7 @@ class Projects::LfsStorageController < Projects::GitHttpClientController link_to_project!(object) end + # rubocop: enable CodeReuse/ActiveRecord def create_file!(oid, size) uploaded_file = UploadedFile.from_params( @@ -75,9 +77,11 @@ class Projects::LfsStorageController < Projects::GitHttpClientController LfsObject.create!(oid: oid, size: size, file: uploaded_file) end + # rubocop: disable CodeReuse/ActiveRecord def link_to_project!(object) if object && !object.projects.exists?(storage_project.id) object.lfs_objects_projects.create!(project: storage_project) end end + # rubocop: enable CodeReuse/ActiveRecord end |