effective_mentorships 0.4.0 → 0.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/app/datatables/admin/effective_mentorship_bulk_group_mentees_datatable.rb +4 -4
- data/app/datatables/admin/effective_mentorship_bulk_group_mentors_datatable.rb +4 -4
- data/app/datatables/admin/effective_mentorship_group_users_datatable.rb +3 -0
- data/app/datatables/admin/effective_mentorship_registrations_datatable.rb +4 -0
- data/app/models/concerns/effective_mentorships_registration.rb +4 -8
- data/lib/effective_mentorships/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: d44aadbbf12084b545f6f33ebb05f58b83cb8dbb8fc8f8d74bf3366aeb0a0c7e
|
|
4
|
+
data.tar.gz: df11f3c39ff546de09a7fcb27dfbd79950102f38cc7801fba57526a2b4a55462
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 3ed82bb50811e0f2e264f5524c224e0571a6c94eb12b654819151731562696aef9e34f81b932bb10e3aa7fd330f9217bf413de9561b67957457231f954ff0ba7
|
|
7
|
+
data.tar.gz: 8460ecc93151220f06b4265b745fae908b4ea61b479275b4a5ded946880a2d461b1929b2c0526b0329f1aac54f203125506aad47b6393fadb58bc08851d16b51
|
|
@@ -13,11 +13,11 @@ module Admin
|
|
|
13
13
|
col 'user.last_name', visible: false
|
|
14
14
|
col 'user.email', visible: false
|
|
15
15
|
|
|
16
|
-
if defined?(EffectiveMemberships)
|
|
16
|
+
if defined?(EffectiveMemberships) && EffectiveMemberships.Membership
|
|
17
17
|
col(:member_number, label: 'Member #', sort: false, visible: false) do |registration|
|
|
18
18
|
registration.user.try(:membership).try(:number)
|
|
19
19
|
end.search do |collection, term|
|
|
20
|
-
memberships =
|
|
20
|
+
memberships = EffectiveMemberships.Membership.where(owner_type: current_user.class.name).where('number ILIKE ?', "%#{term}%")
|
|
21
21
|
collection.where(user_id: memberships.select('owner_id'))
|
|
22
22
|
end
|
|
23
23
|
|
|
@@ -26,7 +26,7 @@ module Admin
|
|
|
26
26
|
content_tag(:div, membership_category, class: 'col-resource')
|
|
27
27
|
end.join.html_safe
|
|
28
28
|
end.search do |collection, term|
|
|
29
|
-
memberships =
|
|
29
|
+
memberships = EffectiveMemberships.Membership.where(owner_type: current_user.class.name).with_category(term)
|
|
30
30
|
collection.where(user_id: memberships.select('owner_id'))
|
|
31
31
|
end
|
|
32
32
|
|
|
@@ -35,7 +35,7 @@ module Admin
|
|
|
35
35
|
content_tag(:div, status, class: 'col-resource')
|
|
36
36
|
end.join.html_safe
|
|
37
37
|
end.search do |collection, term|
|
|
38
|
-
memberships =
|
|
38
|
+
memberships = EffectiveMemberships.Membership.where(owner_type: current_user.class.name).with_status(term)
|
|
39
39
|
collection.where(user_id: memberships.select('owner_id'))
|
|
40
40
|
end
|
|
41
41
|
end
|
|
@@ -13,11 +13,11 @@ module Admin
|
|
|
13
13
|
col 'user.last_name', visible: false
|
|
14
14
|
col 'user.email', visible: false
|
|
15
15
|
|
|
16
|
-
if defined?(EffectiveMemberships)
|
|
16
|
+
if defined?(EffectiveMemberships) && EffectiveMemberships.Membership
|
|
17
17
|
col(:member_number, label: 'Member #', sort: false, visible: false) do |registration|
|
|
18
18
|
registration.user.try(:membership).try(:number)
|
|
19
19
|
end.search do |collection, term|
|
|
20
|
-
memberships =
|
|
20
|
+
memberships = EffectiveMemberships.Membership.where(owner_type: current_user.class.name).where('number ILIKE ?', "%#{term}%")
|
|
21
21
|
collection.where(user_id: memberships.select('owner_id'))
|
|
22
22
|
end
|
|
23
23
|
|
|
@@ -26,7 +26,7 @@ module Admin
|
|
|
26
26
|
content_tag(:div, membership_category, class: 'col-resource')
|
|
27
27
|
end.join.html_safe
|
|
28
28
|
end.search do |collection, term|
|
|
29
|
-
memberships =
|
|
29
|
+
memberships = EffectiveMemberships.Membership.where(owner_type: current_user.class.name).with_category(term)
|
|
30
30
|
collection.where(user_id: memberships.select('owner_id'))
|
|
31
31
|
end
|
|
32
32
|
|
|
@@ -35,7 +35,7 @@ module Admin
|
|
|
35
35
|
content_tag(:div, status, class: 'col-resource')
|
|
36
36
|
end.join.html_safe
|
|
37
37
|
end.search do |collection, term|
|
|
38
|
-
memberships =
|
|
38
|
+
memberships = EffectiveMemberships.Membership.where(owner_type: current_user.class.name).with_status(term)
|
|
39
39
|
collection.where(user_id: memberships.select('owner_id'))
|
|
40
40
|
end
|
|
41
41
|
end
|
|
@@ -4,6 +4,7 @@ module Admin
|
|
|
4
4
|
scope :all
|
|
5
5
|
scope :opt_in
|
|
6
6
|
scope :opt_out
|
|
7
|
+
scope :opt_in_with_groups
|
|
7
8
|
scope :opt_in_without_groups
|
|
8
9
|
end
|
|
9
10
|
|
|
@@ -17,6 +18,9 @@ module Admin
|
|
|
17
18
|
|
|
18
19
|
col :mentorship_cycle, search: :select
|
|
19
20
|
col :user
|
|
21
|
+
col :email do |registration|
|
|
22
|
+
registration.user.email
|
|
23
|
+
end
|
|
20
24
|
|
|
21
25
|
col :opt_in, visible: attributes[:opt_in_without_groups].blank?
|
|
22
26
|
|
|
@@ -96,27 +96,23 @@ module EffectiveMentorshipsRegistration
|
|
|
96
96
|
scope :mentees, -> { where(mentorship_role: :mentee) }
|
|
97
97
|
scope :opt_in, -> { where(opt_in: true) }
|
|
98
98
|
scope :opt_out, -> { where(opt_in: false) }
|
|
99
|
+
scope :opt_in_with_groups, -> { opt_in.with_groups }
|
|
99
100
|
scope :opt_in_without_groups, -> { opt_in.without_groups }
|
|
100
101
|
|
|
101
102
|
scope :in_person, -> { where(venue: 'In-person') }
|
|
102
103
|
scope :virtual, -> { where(venue: 'Virtual') }
|
|
103
104
|
scope :either, -> { where(venue: 'Either') }
|
|
104
105
|
|
|
105
|
-
scope :with_groups, -> {
|
|
106
|
-
group_users = Effective::MentorshipGroupUser.
|
|
106
|
+
scope :with_groups, -> {
|
|
107
|
+
group_users = Effective::MentorshipGroupUser.where.not(mentorship_registration_id: nil)
|
|
107
108
|
where(id: group_users.select(:mentorship_registration_id))
|
|
108
109
|
}
|
|
109
110
|
|
|
110
111
|
scope :without_groups, -> {
|
|
111
|
-
group_users = Effective::MentorshipGroupUser.
|
|
112
|
+
group_users = Effective::MentorshipGroupUser.where.not(mentorship_registration_id: nil)
|
|
112
113
|
where.not(id: group_users.select(:mentorship_registration_id))
|
|
113
114
|
}
|
|
114
115
|
|
|
115
|
-
scope :with_groups, -> {
|
|
116
|
-
group_users = Effective::MentorshipGroupUser.all
|
|
117
|
-
where(id: group_users.select(:mentorship_registration_id))
|
|
118
|
-
}
|
|
119
|
-
|
|
120
116
|
scope :with_groups_from, -> (mentorship_bulk_group) {
|
|
121
117
|
groups = EffectiveMentorships.MentorshipGroup.where(mentorship_bulk_group: mentorship_bulk_group)
|
|
122
118
|
group_users = Effective::MentorshipGroupUser.where(mentorship_group_id: groups.select(:mentorship_group_id))
|