effective_memberships 0.9.12 → 0.9.14
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 813c2bf0f2491dd88f28e0deb9b66353c5fce7e08bbd60facdcadc4df29f3c63
|
4
|
+
data.tar.gz: e856e0600b5e5943565509c20ad06e7a1da807546169b1058b9d5e7b784e3fb2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0a54c8464c3547b7040f987e06abaca0100c31d5ccd8e976c68fc432dce308ec555b3050cf618f58ac3d54e8fefa743cee91eb8134c400be05cc13a628d08603
|
7
|
+
data.tar.gz: 6e8363b016b80e3dfd3e9930586cb8bd57f957dcf0d11d0687b5f049445fb2c0964615a027f12fdb60982f7ab63318d4740b7d61a8ba6c692307a1b65baf9405
|
@@ -202,15 +202,14 @@ module EffectiveMembershipsRegistrar
|
|
202
202
|
|
203
203
|
def reinstate!(owner, to: nil, date: nil, skip_fees: false)
|
204
204
|
raise('expecting a memberships owner') unless owner.class.respond_to?(:effective_memberships_owner?)
|
205
|
-
raise('owner must have a removed membership.') unless owner.membership_removed?
|
206
205
|
|
207
|
-
history = owner.reinstatement_membership_history
|
208
|
-
raise('owner must have a
|
206
|
+
history = owner.reinstatement_membership_history || owner.membership_histories.last
|
207
|
+
raise('owner must have a removed membership history or some kind of history.') if history.blank?
|
209
208
|
|
210
209
|
to ||= owner.reinstatement_membership_category
|
211
210
|
raise('expecting a to memberships category') unless to.class.respond_to?(:effective_memberships_category?)
|
212
211
|
|
213
|
-
statuses = owner.reinstatement_membership_statuses
|
212
|
+
statuses = Array(owner.reinstatement_membership_statuses)
|
214
213
|
|
215
214
|
# Default Date
|
216
215
|
date ||= Time.zone.now
|
@@ -27,9 +27,11 @@ module Effective
|
|
27
27
|
user.password ||= SecureRandom.base64(12) + '!@#123abcABC-'
|
28
28
|
end
|
29
29
|
|
30
|
-
after_commit(on: [:create, :destroy], if: -> { user.class.respond_to?(:effective_memberships_owner?) }) do
|
31
|
-
|
32
|
-
|
30
|
+
after_commit(on: [:create, :destroy], if: -> { user.class.respond_to?(:effective_memberships_owner?) && organization.class.respond_to?(:effective_memberships_owner?) }) do
|
31
|
+
if organization.membership_present?
|
32
|
+
user.representatives.reload
|
33
|
+
user.update_member_role!
|
34
|
+
end
|
33
35
|
end
|
34
36
|
|
35
37
|
validates :organization, presence: true
|
@@ -9,7 +9,7 @@
|
|
9
9
|
%p
|
10
10
|
- if applicant.owner.membership&.number_was.present?
|
11
11
|
The member will keep their existing membership number: #{applicant.owner.membership.number}.
|
12
|
-
- elsif applicant.reinstatement? && reinstatement
|
12
|
+
- elsif applicant.reinstatement? && reinstatement&.number.present?
|
13
13
|
The member will keep their previous membership number: #{reinstatement.number}.
|
14
14
|
- else
|
15
15
|
- number = EffectiveMemberships.Registrar.next_membership_number(applicant.owner, to: applicant.category)
|
@@ -19,7 +19,7 @@
|
|
19
19
|
- else
|
20
20
|
No membership number will be assigned.
|
21
21
|
|
22
|
-
- if applicant.reinstatement?
|
22
|
+
- if applicant.reinstatement? && reinstatement.present?
|
23
23
|
%p The member will be reinstated with their previous status: #{badges(reinstatement.membership_statuses) || 'None'}.
|
24
24
|
|
25
25
|
%h3 Fees
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: effective_memberships
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.9.
|
4
|
+
version: 0.9.14
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Code and Effect
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-01-
|
11
|
+
date: 2023-01-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|