Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
open-source
aoz-003
Commits
78cd7867
Commit
78cd7867
authored
Feb 02, 2018
by
Tugce Nur Tas
Browse files
some nitpicking on seed comments
parent
8fbb8175
Changes
1
Hide whitespace changes
Inline
Side-by-side
db/seeds.rb
View file @
78cd7867
...
...
@@ -71,7 +71,7 @@ def create_two_group_offers(group_offer_category)
GroupOffer
,
GroupAssignment
)
end
#
C
reate
v
olunteers for each acceptance type
#
c
reate
V
olunteers for each acceptance type
Volunteer
.
acceptance_collection
.
each
do
|
acceptance
|
if
[
'undecided'
,
'rejected'
].
include?
(
acceptance
)
FactoryBot
.
create
(
:volunteer_seed
,
acceptance:
acceptance
,
user_id:
nil
)
...
...
@@ -81,13 +81,13 @@ Volunteer.acceptance_collection.each do |acceptance|
end
puts_model_counts
(
'After Volunteer created'
,
User
,
Volunteer
,
Client
)
#
C
reate
c
lients for each acceptance type
#
c
reate
C
lients for each acceptance type
Client
.
acceptance_collection_restricted
.
each
do
|
acceptance
|
FactoryBot
.
create
(
:client
,
acceptance:
acceptance
,
user:
User
.
superadmins
.
first
)
end
puts_model_counts
(
'After Client created'
,
User
,
Volunteer
,
Client
)
#
C
reate EmailTemplates
#
c
reate EmailTemplates
if
EmailTemplate
.
count
<
1
FactoryBot
.
create
:email_template_seed
,
active:
true
2
.
times
do
...
...
@@ -108,9 +108,9 @@ if EmailTemplate.count < 1
end
puts_model_counts
(
'After EmailTemplates created'
,
User
,
EmailTemplate
)
#
C
reate
a
ssignments
#
c
reate
A
ssignments
if
Assignment
.
count
<
1
#
probezeit a
ssignments
#
trial A
ssignments
Array
.
new
(
3
).
map
{
FactoryBot
.
create
(
:volunteer_seed_with_user
,
acceptance:
'accepted'
)
}
.
each
do
|
volunteer
|
FactoryBot
.
create
(
...
...
@@ -122,7 +122,7 @@ if Assignment.count < 1
period_end:
nil
)
end
# half_year
a
ssignments
# half_year
A
ssignments
Array
.
new
(
3
).
map
{
FactoryBot
.
create
(
:volunteer_seed_with_user
,
acceptance:
'accepted'
)
}
.
each
do
|
volunteer
|
assignment
=
FactoryBot
.
create
(
...
...
@@ -206,7 +206,7 @@ if ClientNotification.count < 1
end
puts_model_counts
(
'After ClientNotification created'
,
User
,
Client
,
ClientNotification
)
# make sure the state is correct, after stuff has bee
e
n done via FactoryBot
# make sure the state is correct, after stuff has been done via FactoryBot
Volunteer
.
accepted
.
map
(
&
:verify_and_update_state
)
puts_model_counts
(
'Total Summup'
,
GroupAssignmentLog
,
LanguageSkill
,
ReminderMailingVolunteer
,
...
...
Write
Preview
Supports
Markdown
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