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
71401814
Commit
71401814
authored
Jun 07, 2019
by
charlieablett
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add `to_json` to `represent` method call
parent
27dd0b8e
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
3 additions
and
3 deletions
+3
-3
app/controllers/concerns/boards_responses.rb
app/controllers/concerns/boards_responses.rb
+1
-1
changelogs/unreleased/3861-use-serializers-for-project-group-boards.yml
...eleased/3861-use-serializers-for-project-group-boards.yml
+0
-0
spec/controllers/concerns/boards_responses_spec.rb
spec/controllers/concerns/boards_responses_spec.rb
+2
-2
No files found.
app/controllers/concerns/boards_responses.rb
View file @
71401814
...
@@ -69,7 +69,7 @@ module BoardsResponses
...
@@ -69,7 +69,7 @@ module BoardsResponses
end
end
def
serialize_as_json
(
resource
)
def
serialize_as_json
(
resource
)
serializer
.
represent
(
resource
)
serializer
.
represent
(
resource
)
.
to_json
end
end
def
respond_with
(
resource
)
def
respond_with
(
resource
)
...
...
changelogs/unreleased/
ce-
3861-use-serializers-for-project-group-boards.yml
→
changelogs/unreleased/3861-use-serializers-for-project-group-boards.yml
View file @
71401814
File moved
spec/controllers/concerns/boards_responses_spec.rb
View file @
71401814
...
@@ -15,9 +15,9 @@ describe BoardsResponses do
...
@@ -15,9 +15,9 @@ describe BoardsResponses do
let!
(
:board
)
{
create
(
:board
)
}
let!
(
:board
)
{
create
(
:board
)
}
it
'serializes properly'
do
it
'serializes properly'
do
expected
=
{
id:
board
.
id
}
expected
=
{
"id"
=>
board
.
id
}
expect
(
subject
.
serialize_as_json
(
board
).
to_h
).
to
include
(
expected
)
expect
(
JSON
.
parse
(
subject
.
serialize_as_json
(
board
))
).
to
include
(
expected
)
end
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