summaryrefslogtreecommitdiff
path: root/lib/gitlab/background_migration/populate_untracked_uploads.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/gitlab/background_migration/populate_untracked_uploads.rb')
-rw-r--r--lib/gitlab/background_migration/populate_untracked_uploads.rb20
1 files changed, 0 insertions, 20 deletions
diff --git a/lib/gitlab/background_migration/populate_untracked_uploads.rb b/lib/gitlab/background_migration/populate_untracked_uploads.rb
index c5f9d998d9e..f2207fa4e72 100644
--- a/lib/gitlab/background_migration/populate_untracked_uploads.rb
+++ b/lib/gitlab/background_migration/populate_untracked_uploads.rb
@@ -153,29 +153,9 @@ module Gitlab
belongs_to :model, polymorphic: true # rubocop:disable Cop/PolymorphicAssociations
- validates :size, presence: true
- validates :path, presence: true
- validates :model, presence: true
- validates :uploader, presence: true
-
before_save :calculate_checksum, if: :foreground_checksum?
after_commit :schedule_checksum, unless: :foreground_checksum?
- def self.remove_path(path)
- where(path: path).destroy_all
- end
-
- def self.record(uploader)
- remove_path(uploader.relative_path)
-
- create(
- size: uploader.file.size,
- path: uploader.relative_path,
- model: uploader.model,
- uploader: uploader.class.to_s
- )
- end
-
def absolute_path
return path unless relative_path?