effective_memberships 0.9.13 → 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: b9433add3d7d0b17df72da4ff6041b5667d2d57361b58d1f0a33e6c58e9a75ed
4
- data.tar.gz: 68b962790a39557618f6b3f43bf79ad1d9416631b5bf7a48eba8296d68f9afc2
3
+ metadata.gz: 813c2bf0f2491dd88f28e0deb9b66353c5fce7e08bbd60facdcadc4df29f3c63
4
+ data.tar.gz: e856e0600b5e5943565509c20ad06e7a1da807546169b1058b9d5e7b784e3fb2
5
5
  SHA512:
6
- metadata.gz: 79784d64235015655ef74cb86025ea250b97984984b307508f7897d9800b48fae553fdcb7815d00a8332160ec2bd4d41667c89707ee1bd81871d181b3c5d8f29
7
- data.tar.gz: 8d2063383c55489ab29f5a2f2532c2086f0827affae2d52cb5e29a973ea1e26f21125cdb61a5b7c344a4b9896cb65151520239e6a7287bcff5bc32d86edd2dfa
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 reinstatement membership history.') if history.blank?
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
@@ -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.number.present?
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
@@ -1,3 +1,3 @@
1
1
  module EffectiveMemberships
2
- VERSION = '0.9.13'
2
+ VERSION = '0.9.14'
3
3
  end
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.13
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-12 00:00:00.000000000 Z
11
+ date: 2023-01-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails