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
1
Merge Requests
1
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
nexedi
gitlab-ce
Commits
71f4ae4a
Commit
71f4ae4a
authored
Feb 01, 2018
by
Micaël Bergeron
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixing the move_to_* pattern
parent
787e4345
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
13 additions
and
15 deletions
+13
-15
app/uploaders/avatar_uploader.rb
app/uploaders/avatar_uploader.rb
+8
-0
app/uploaders/gitlab_uploader.rb
app/uploaders/gitlab_uploader.rb
+2
-4
ee/app/uploaders/object_storage.rb
ee/app/uploaders/object_storage.rb
+0
-8
spec/factories/groups.rb
spec/factories/groups.rb
+1
-1
spec/factories/projects.rb
spec/factories/projects.rb
+1
-1
spec/factories/users.rb
spec/factories/users.rb
+1
-1
No files found.
app/uploaders/avatar_uploader.rb
View file @
71f4ae4a
...
...
@@ -8,6 +8,14 @@ class AvatarUploader < GitlabUploader
model
.
avatar
.
file
&&
model
.
avatar
.
file
.
present?
end
def
move_to_store
false
end
def
move_to_cache
false
end
private
def
dynamic_segment
...
...
app/uploaders/gitlab_uploader.rb
View file @
71f4ae4a
...
...
@@ -33,14 +33,12 @@ class GitlabUploader < CarrierWave::Uploader::Base
cache_storage
.
is_a?
(
CarrierWave
::
Storage
::
File
)
end
# Reduce disk IO
def
move_to_cache
super
.
nil?
?
true
:
super
file_storage?
end
# Reduce disk IO
def
move_to_store
super
.
nil?
?
true
:
super
file_storage?
end
def
exists?
...
...
ee/app/uploaders/object_storage.rb
View file @
71f4ae4a
...
...
@@ -202,14 +202,6 @@ module ObjectStorage
false
end
def
move_to_store
false
end
def
move_to_cache
false
end
def
delete_migrated_file
(
migrated_file
)
migrated_file
.
delete
if
exists?
end
...
...
spec/factories/groups.rb
View file @
71f4ae4a
...
...
@@ -19,7 +19,7 @@ FactoryBot.define do
end
trait
:with_avatar
do
avatar
{
File
.
open
(
Rails
.
root
.
join
(
'spec/fixtures/dk.png'
)
)
}
avatar
{
fixture_file_upload
(
'spec/fixtures/dk.png'
)
}
end
factory
:group_with_members
do
...
...
spec/factories/projects.rb
View file @
71f4ae4a
...
...
@@ -122,7 +122,7 @@ FactoryBot.define do
end
trait
:with_avatar
do
avatar
{
File
.
open
(
Rails
.
root
.
join
(
'spec/fixtures/dk.png'
)
)
}
avatar
{
fixture_file_upload
(
'spec/fixtures/dk.png'
)
}
end
trait
:broken_storage
do
...
...
spec/factories/users.rb
View file @
71f4ae4a
...
...
@@ -42,7 +42,7 @@ FactoryBot.define do
end
trait
:with_avatar
do
avatar
{
File
.
open
(
Rails
.
root
.
join
(
'spec/fixtures/dk.png'
)
)
}
avatar
{
fixture_file_upload
(
'spec/fixtures/dk.png'
)
}
end
trait
:two_factor_via_otp
do
...
...
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