Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
heptapod
heptapod
Commits
f5a91924ceb8
Commit
c69914bf
authored
Nov 14, 2017
by
Michael Kozono
Browse files
Remove irrelevant copy-pasted code
parent
2f5bc6cf6f55
Changes
1
Hide whitespace changes
Inline
Side-by-side
lib/gitlab/background_migration/populate_untracked_uploads.rb
View file @
f5a91924
...
...
@@ -153,29 +153,9 @@ class Upload < ActiveRecord::Base
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?
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment