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
aaded49d
Commit
aaded49d
authored
Aug 14, 2012
by
Rocky Duan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add course-specific user information
parent
25eb96ad
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
1 deletions
+6
-1
app.rb
+1
-1
models/user.rb
+5
-0
No files found.
app.rb
View file @
aaded49d
...
@@ -285,7 +285,7 @@ post "#{api_prefix}/users" do
...
@@ -285,7 +285,7 @@ post "#{api_prefix}/users" do
end
end
get
"
#{
api_prefix
}
/users/:user_id"
do
|
user_id
|
get
"
#{
api_prefix
}
/users/:user_id"
do
|
user_id
|
user
.
to_hash
(
complete:
bool_complete
).
to_json
user
.
to_hash
(
complete:
bool_complete
,
course_id:
params
[
"course_id"
]
).
to_json
end
end
put
"
#{
api_prefix
}
/users/:user_id"
do
|
user_id
|
put
"
#{
api_prefix
}
/users/:user_id"
do
|
user_id
|
...
...
models/user.rb
View file @
aaded49d
...
@@ -64,6 +64,11 @@ class User
...
@@ -64,6 +64,11 @@ class User
"upvoted_ids"
=>
upvoted_ids
,
"upvoted_ids"
=>
upvoted_ids
,
"downvoted_ids"
=>
downvoted_ids
)
"downvoted_ids"
=>
downvoted_ids
)
end
end
if
params
[
:course_id
]
hash
=
hash
.
merge
(
"threads_count"
=>
comment_threads
.
where
(
course_id:
params
[
:course_id
]).
count
,
"comments_count"
=>
comments
.
where
(
course_id:
params
[
:course_id
]).
count
,
)
end
hash
hash
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