Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
gab-social
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
gab
social
gab-social
Commits
6b4969db
Commit
6b4969db
authored
Sep 17, 2019
by
mgabdev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Updated media attachment on create to always include account param
parent
956c06ea
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
1 deletion
+1
-1
app/controllers/api/v1/media_controller.rb
app/controllers/api/v1/media_controller.rb
+1
-1
No files found.
app/controllers/api/v1/media_controller.rb
View file @
6b4969db
...
...
@@ -10,7 +10,7 @@ class Api::V1::MediaController < Api::BaseController
respond_to
:json
def
create
@media
=
current_account
.
media_attachments
.
create!
(
media_params
)
@media
=
current_account
.
media_attachments
.
create!
(
account:
current_account
,
file:
media_params
[
:file
],
description:
media_params
[
:description
],
focus:
media_params
[
:focus
]
)
render
json:
@media
,
serializer:
REST
::
MediaAttachmentSerializer
rescue
Paperclip
::
Errors
::
NotIdentifiedByImageMagickError
render
json:
file_type_error
,
status:
422
...
...
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