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
Léo-Paul Géneau
gitlab-ce
Commits
78cd1963
Commit
78cd1963
authored
Sep 10, 2018
by
James Lopez
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix avatar uploader error
parent
fab15563
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
1 deletion
+9
-1
app/uploaders/avatar_uploader.rb
app/uploaders/avatar_uploader.rb
+1
-1
spec/uploaders/avatar_uploader_spec.rb
spec/uploaders/avatar_uploader_spec.rb
+8
-0
No files found.
app/uploaders/avatar_uploader.rb
View file @
78cd1963
...
@@ -19,7 +19,7 @@ class AvatarUploader < GitlabUploader
...
@@ -19,7 +19,7 @@ class AvatarUploader < GitlabUploader
end
end
def
absolute_path
def
absolute_path
self
.
class
.
absolute_path
(
model
.
avatar
)
self
.
class
.
absolute_path
(
model
.
avatar
.
upload
)
end
end
private
private
...
...
spec/uploaders/avatar_uploader_spec.rb
View file @
78cd1963
...
@@ -35,5 +35,13 @@ describe AvatarUploader do
...
@@ -35,5 +35,13 @@ describe AvatarUploader do
it_behaves_like
"migrates"
,
to_store:
described_class
::
Store
::
REMOTE
it_behaves_like
"migrates"
,
to_store:
described_class
::
Store
::
REMOTE
it_behaves_like
"migrates"
,
from_store:
described_class
::
Store
::
REMOTE
,
to_store:
described_class
::
Store
::
LOCAL
it_behaves_like
"migrates"
,
from_store:
described_class
::
Store
::
REMOTE
,
to_store:
described_class
::
Store
::
LOCAL
it
'sets the right absolute path'
do
storage_path
=
Gitlab
.
config
.
uploads
.
storage_path
absolute_path
=
File
.
join
(
storage_path
,
upload
.
path
)
expect
(
uploader
.
absolute_path
.
scan
(
storage_path
).
size
).
to
eq
(
1
)
expect
(
uploader
.
absolute_path
).
to
eq
(
absolute_path
)
end
end
end
end
end
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