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
eb369af3
Commit
eb369af3
authored
Aug 04, 2012
by
Rocky Duan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
updated rakefile for change in user
parent
5b85a216
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
3 deletions
+12
-3
Rakefile
+12
-3
No files found.
Rakefile
View file @
eb369af3
...
@@ -17,8 +17,17 @@ task :environment do
...
@@ -17,8 +17,17 @@ task :environment do
CommentService
.
config
=
YAML
.
load_file
(
"config/application.yml"
)
CommentService
.
config
=
YAML
.
load_file
(
"config/application.yml"
)
Dir
[
File
.
join
(
File
.
dirname
(
__FILE__
),
'models'
,
'**'
,
'*.rb'
)].
each
{
|
file
|
require
file
}
Dir
[
File
.
dirname
(
__FILE__
)
+
'/lib/**/*.rb'
].
each
{
|
file
|
require
file
}
Dir
[
File
.
dirname
(
__FILE__
)
+
'/models/*.rb'
].
each
{
|
file
|
require
file
}
Dir
[
File
.
dirname
(
__FILE__
)
+
'/models/observers/*.rb'
].
each
{
|
file
|
require
file
}
Mongoid
.
observers
=
PostReplyObserver
,
PostTopicObserver
,
AtUserObserver
Mongoid
.
instantiate_observers
end
def
create_test_user
(
id
)
User
.
create!
(
external_id:
id
,
username:
"user
#{
id
}
"
,
email:
"user
#{
id
}
@test.com"
)
end
end
namespace
:test
do
namespace
:test
do
...
@@ -31,7 +40,7 @@ namespace :test do
...
@@ -31,7 +40,7 @@ namespace :test do
Notification
.
delete_all
Notification
.
delete_all
Subscription
.
delete_all
Subscription
.
delete_all
user
=
User
.
create!
(
external_id:
"1"
)
user
=
create_test_user
(
1
)
comment_thread
=
CommentThread
.
new
(
title:
"I can't solve this problem"
,
body:
"can anyone help me?"
,
course_id:
"1"
,
commentable_id:
"question_1"
)
comment_thread
=
CommentThread
.
new
(
title:
"I can't solve this problem"
,
body:
"can anyone help me?"
,
course_id:
"1"
,
commentable_id:
"question_1"
)
comment_thread
.
author
=
user
comment_thread
.
author
=
user
...
@@ -170,7 +179,7 @@ namespace :db do
...
@@ -170,7 +179,7 @@ namespace :db do
beginning_time
=
Time
.
now
beginning_time
=
Time
.
now
users
=
(
1
..
5
).
map
{
|
id
|
User
.
find_or_create_by
(
external_id:
id
.
to_s
)}
users
=
(
1
..
10
).
map
{
|
id
|
create_test_user
(
id
)}
3
.
times
do
3
.
times
do
other_user
=
users
[
1
..
9
].
sample
other_user
=
users
[
1
..
9
].
sample
users
.
first
.
subscribe
(
other_user
)
users
.
first
.
subscribe
(
other_user
)
...
...
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