|
@@ -83,30 +83,30 @@ end
|
83
|
83
|
|
84
|
84
|
Person.all.each do |p|
|
85
|
85
|
Group.all.each do |g|
|
86
|
|
- if Faker::Boolean.boolean(0.75)
|
87
|
|
- Member.create!(
|
88
|
|
- person: p,
|
89
|
|
- group: g,
|
90
|
|
- is_leader: Faker::Boolean.boolean(0.1)
|
91
|
|
- )
|
92
|
|
- g.activities.each do |a|
|
93
|
|
- if Faker::Boolean.boolean(0.15)
|
94
|
|
- notes = Faker::Hipster.sentence
|
95
|
|
- else
|
96
|
|
- notes = nil
|
97
|
|
- end
|
|
86
|
+ next unless Faker::Boolean.boolean(0.75)
|
98
|
87
|
|
99
|
|
- # Participants are created on adding to group, no need to create
|
100
|
|
- part = Participant.find_by(
|
101
|
|
- activity: a,
|
102
|
|
- person: p
|
103
|
|
- )
|
104
|
|
- part.update!(
|
105
|
|
- is_organizer: Faker::Boolean.boolean(0.1),
|
106
|
|
- attending: [true, false, nil].sample,
|
107
|
|
- notes: notes
|
108
|
|
- )
|
|
88
|
+ Member.create!(
|
|
89
|
+ person: p,
|
|
90
|
+ group: g,
|
|
91
|
+ is_leader: Faker::Boolean.boolean(0.1)
|
|
92
|
+ )
|
|
93
|
+ g.activities.each do |a|
|
|
94
|
+ if Faker::Boolean.boolean(0.15)
|
|
95
|
+ notes = Faker::Hipster.sentence
|
|
96
|
+ else
|
|
97
|
+ notes = nil
|
109
|
98
|
end
|
|
99
|
+
|
|
100
|
+ # Participants are created on adding to group, no need to create
|
|
101
|
+ part = Participant.find_by(
|
|
102
|
+ activity: a,
|
|
103
|
+ person: p
|
|
104
|
+ )
|
|
105
|
+ part.update!(
|
|
106
|
+ is_organizer: Faker::Boolean.boolean(0.1),
|
|
107
|
+ attending: [true, false, nil].sample,
|
|
108
|
+ notes: notes
|
|
109
|
+ )
|
110
|
110
|
end
|
111
|
111
|
end
|
112
|
112
|
end
|