Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
cs_comments_service
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
cs_comments_service
Commits
c2b41750
Commit
c2b41750
authored
Jun 27, 2012
by
Rocky Duan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
should return sub comment
parent
9d68984b
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
4 deletions
+4
-4
app.rb
+3
-3
spec/app_spec.rb
+1
-1
No files found.
app.rb
View file @
c2b41750
...
@@ -59,10 +59,10 @@ post '/api/v1/comments/:comment_id' do |comment_id|
...
@@ -59,10 +59,10 @@ post '/api/v1/comments/:comment_id' do |comment_id|
else
else
comment_params
=
params
.
select
{
|
key
,
value
|
%w{body title user_id course_id}
.
include?
key
}.
merge
({
:comment_thread_id
=>
comment
.
comment_thread_id
})
comment_params
=
params
.
select
{
|
key
,
value
|
%w{body title user_id course_id}
.
include?
key
}.
merge
({
:comment_thread_id
=>
comment
.
comment_thread_id
})
sub_comment
=
comment
.
children
.
create
(
comment_params
)
sub_comment
=
comment
.
children
.
create
(
comment_params
)
if
comment
.
valid?
if
sub_
comment
.
valid?
comment
.
to_json
sub_
comment
.
to_json
else
else
error
400
,
comment
.
errors
.
to_json
error
400
,
sub_
comment
.
errors
.
to_json
end
end
end
end
end
end
...
...
spec/app_spec.rb
View file @
c2b41750
...
@@ -119,7 +119,7 @@ describe "app" do
...
@@ -119,7 +119,7 @@ describe "app" do
c
[
"votes"
][
"up"
].
should
==
0
c
[
"votes"
][
"up"
].
should
==
0
c
[
"votes"
][
"down"
].
should
==
0
c
[
"votes"
][
"down"
].
should
==
0
c
[
"votes"
][
"plusminus"
].
should
==
0
c
[
"votes"
][
"plusminus"
].
should
==
0
c
[
"children"
].
should
be_nil
c
[
"children"
].
length
.
should
==
0
end
end
end
end
describe
"DELETE on /api/v1/commentables/:commentable_type/:commentable_id"
do
describe
"DELETE on /api/v1/commentables/:commentable_type/:commentable_id"
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