effective_mentorships 0.3.0 → 0.3.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 95229a4d568c5fc8d66a4cdd38218cbe2dc2ff9c352c3f23a7acda317fb0bce3
4
- data.tar.gz: 7d9ca438ab03dfc14ba509eac03921a43e84c76189f9238481ec0cda7074ad58
3
+ metadata.gz: 51540f932b6939477810dbc83ca434c9a1f645e02ad8ce1bdfbf6ecf97254dbc
4
+ data.tar.gz: 5561bd5faa4e649f72702f9f861ca0571c47f92f6a719d866e64aead6ccf500d
5
5
  SHA512:
6
- metadata.gz: 7b3cce00a2d088be42079fe29e905fafcaf385ebec8f6a2e90600bf8308155011907683ed744aa7e44ad8ece78b5fecd2e314488a1bd7cf0ed4649d138d2e13c
7
- data.tar.gz: 4e83bdcce4526ac587f9bc322d22e31e73452905cee86d896adcd970e3b35ac062c33b712bcf8dac82507ecc23951415091e9a677b5d4d5186d63bd4ee631cc1
6
+ metadata.gz: 42f67c456e342f4abf4be9983246c6d01172db3e9a4bb36980c597a74153dc401bb3ac3e8056e94982b6344e5e90e98506c91e215e979451e0fa4f0cb00b8c1a
7
+ data.tar.gz: 6575760097d8daf6fe4160313eee73eb7c180464cdeaa16a910b5107b7e69be4cce7295c7b5a6c22f44778aa53a0af69639123be69f4850daf9220ca9970a89e
@@ -126,9 +126,10 @@ module EffectiveMentorshipsBulkGroup
126
126
 
127
127
  # Called by Effective::MentorshipsBulkCreateGroupsJob
128
128
  def create_groups!
129
- # First pass
130
- # Create groups with 1 mentor and 1 best matching mentee each
131
129
  EffectiveMentorships.MentorshipRegistration.uncached do
130
+ # First pass
131
+ # Create groups with 1 mentor and 1 best matching mentee each
132
+
132
133
  # In-person
133
134
  mentors_mentorship_registrations.without_groups.in_person.find_each do |mentor_registration|
134
135
  mentorship_group = build_mentorship_group(mentor_registration)
@@ -241,7 +242,7 @@ module EffectiveMentorshipsBulkGroup
241
242
 
242
243
  # Fill this group to limit of number of mentees
243
244
  limit = [mentor_registration.mentor_multiple_mentees_limit.to_i, max_pairings_mentee].min
244
- fill_mentees = (limit - mentorship_group.mentorship_group_mentees.length)
245
+ fill_mentees = (limit - mentorship_group.mentorship_group_users.select(&:mentee?).length) # dont use mentorship_group_mentees here
245
246
  return unless fill_mentees > 0
246
247
 
247
248
  # We only support 1 mentor and many mentees
@@ -1,3 +1,3 @@
1
1
  module EffectiveMentorships
2
- VERSION = '0.3.0'
2
+ VERSION = '0.3.1'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: effective_mentorships
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Code and Effect