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
fa7cf193
Commit
fa7cf193
authored
Jul 18, 2012
by
Rocky Duan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed naming
parent
5a61b818
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
4 deletions
+2
-4
app.rb
+2
-4
No files found.
app.rb
View file @
fa7cf193
...
...
@@ -29,8 +29,7 @@ get '/api/v1/:commentable_id/threads' do |commentable_id|
end
post
'/api/v1/:commentable_id/threads'
do
|
commentable_id
|
commentable
=
Commentable
.
find
(
commentable_id
)
thread
=
commentable
.
comment_threads
.
new
(
params
.
slice
(
*
%w[title body course_id]
))
thread
=
CommentThread
.
new
(
params
.
slice
(
*
%w[title body course_id]
).
merge
(
commentable_id:
commentable_id
))
thread
.
author
=
User
.
find_or_create_by
(
external_id:
params
[
"user_id"
])
if
params
[
"user_id"
]
thread
.
save!
thread
.
to_hash
.
to_json
...
...
@@ -93,7 +92,7 @@ end
delete
'/api/v1/comments/:comment_id/votes'
do
|
comment_id
|
comment
=
Comment
.
find
(
comment_id
)
delete
_vote_for
comment
undo
_vote_for
comment
end
put
'/api/v1/threads/:thread_id/votes'
do
|
thread_id
|
...
...
@@ -141,7 +140,6 @@ if env.to_s == "development"
get
'/api/v1/clean'
do
Comment
.
delete_all
CommentThread
.
delete_all
Commentable
.
delete_all
User
.
delete_all
Notification
.
delete_all
Subscription
.
delete_all
...
...
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