Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boxiang Sun
gitlab-ce
Commits
b606636e
Commit
b606636e
authored
Apr 13, 2018
by
Alexis Reigel
Committed by
Alexis Reigel
Jun 05, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
simplify uploader versions check
parent
96d0b1c6
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
9 deletions
+4
-9
app/controllers/concerns/uploads_actions.rb
app/controllers/concerns/uploads_actions.rb
+4
-9
No files found.
app/controllers/concerns/uploads_actions.rb
View file @
b606636e
...
...
@@ -31,17 +31,12 @@ module UploadsActions
disposition
=
uploader
.
image_or_video?
?
'inline'
:
'attachment'
if
uploader
.
filename
==
params
[
:filename
]
return
send_upload
(
uploader
,
attachment:
uploader
.
filename
,
disposition:
disposition
)
end
uploader_version
=
uploader
.
versions
.
values
.
find
{
|
version
|
version
.
filename
==
params
[
:filename
]
}
uploaders
=
[
uploader
,
*
uploader
.
versions
.
values
]
uploader
=
uploaders
.
find
{
|
version
|
version
.
filename
==
params
[
:filename
]
}
if
uploader_version
return
send_upload
(
uploader_version
,
attachment:
uploader_version
.
filename
,
disposition:
disposition
)
end
return
render_404
unless
uploader
render_404
send_upload
(
uploader
,
attachment:
uploader
.
filename
,
disposition:
disposition
)
end
private
...
...
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