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
6bbc43be33d6
Commit
15daf0f1
authored
Sep 10, 2018
by
James Lopez
Browse files
fix avatar uploader error
parent
a4d95c637f01
Changes
2
Hide whitespace changes
Inline
Side-by-side
app/uploaders/avatar_uploader.rb
View file @
6bbc43be
...
...
@@ -19,7 +19,7 @@ def move_to_cache
end
def
absolute_path
self
.
class
.
absolute_path
(
model
.
avatar
)
self
.
class
.
absolute_path
(
model
.
avatar
.
upload
)
end
private
...
...
spec/uploaders/avatar_uploader_spec.rb
View file @
6bbc43be
...
...
@@ -35,5 +35,13 @@
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
'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
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