effective_memberships 0.6.7 → 0.6.8
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/models/concerns/effective_memberships_applicant.rb +9 -3
- data/app/models/concerns/effective_memberships_registrar.rb +5 -4
- data/app/views/effective/applicants/_summary.html.haml +5 -1
- data/app/views/effective/applicants/select/_apply_for_reinstatement.html.haml +1 -1
- data/lib/effective_memberships/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: b1fcdc5cbf08b23f6aab670babdf698a2aff6b6d9d2067055dc970bb2eb4b8e4
|
4
|
+
data.tar.gz: 0a423a28dc16bd84135e741bcb9f290c7997c034ba0095319bab4cf36913d605
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 296aa3d82c05315ac9247f28052e474440562fb85450fc4735f4875b26d67ccdd612df58727207251f2540f103efa41c519128e1366be02f446400816000f3de
|
7
|
+
data.tar.gz: 71feca7c490aea3f2ba49cae7c3318b79d5da533f1b7a6adedcb0ae38a1b9ea2c6b61daa163a9abfc92e2d3e8aff110dbb705c4e373bcfab488aae1d9533a82c
|
@@ -194,8 +194,14 @@ module EffectiveMembershipsApplicant
|
|
194
194
|
# Set Apply to Join or Reclassification
|
195
195
|
before_validation(if: -> { (new_record? || current_step == :select) && owner.present? }) do
|
196
196
|
self.applicant_type ||= can_apply_applicant_types_collection().first
|
197
|
-
|
198
|
-
|
197
|
+
|
198
|
+
if owner.membership.present?
|
199
|
+
self.from_category = owner.membership.categories.first
|
200
|
+
end
|
201
|
+
|
202
|
+
if owner.membership.present? && reinstatement?
|
203
|
+
self.from_status = owner.membership.statuses.find { |status| status.reinstatable? }
|
204
|
+
end
|
199
205
|
end
|
200
206
|
|
201
207
|
before_validation(if: -> { current_step == :experience }) do
|
@@ -779,7 +785,7 @@ module EffectiveMembershipsApplicant
|
|
779
785
|
elsif reclassification?
|
780
786
|
EffectiveMemberships.Registrar.reclassify!(owner, to: category)
|
781
787
|
elsif reinstatement?
|
782
|
-
EffectiveMemberships.Registrar.reinstate!(owner)
|
788
|
+
EffectiveMemberships.Registrar.reinstate!(owner, from: from_status)
|
783
789
|
else
|
784
790
|
raise('unsupported approval applicant_type')
|
785
791
|
end
|
@@ -186,17 +186,18 @@ module EffectiveMembershipsRegistrar
|
|
186
186
|
save!(owner, date: date)
|
187
187
|
end
|
188
188
|
|
189
|
-
def reinstate!(owner, date: nil, skip_fees: false)
|
189
|
+
def reinstate!(owner, from:, date: nil, skip_fees: false)
|
190
190
|
raise('expecting a memberships owner') unless owner.class.respond_to?(:effective_memberships_owner?)
|
191
191
|
raise('owner must have an existing membership. use register! instead') if owner.membership.blank?
|
192
192
|
|
193
|
-
from
|
194
|
-
raise('
|
193
|
+
raise('expecting a from') if from.blank?
|
194
|
+
raise('expected a from status or category') unless from.class.respond_to?(:effective_memberships_status?) || from.class.respond_to?(:effective_memberships_category?)
|
195
195
|
|
196
196
|
date ||= Time.zone.now
|
197
197
|
|
198
198
|
membership = owner.membership
|
199
|
-
membership.membership_status(status: from).mark_for_destruction if from.
|
199
|
+
membership.membership_status(status: from).mark_for_destruction if from.class.respond_to?(:effective_memberships_status?)
|
200
|
+
membership.membership_category(category: from).mark_for_destruction if from.class.respond_to?(:effective_memberships_category?)
|
200
201
|
|
201
202
|
unless skip_fees
|
202
203
|
fee = owner.build_prorated_fee(date: date)
|
@@ -22,7 +22,11 @@
|
|
22
22
|
- else
|
23
23
|
None
|
24
24
|
|
25
|
-
- if applicant.
|
25
|
+
- if applicant.from_status.present?
|
26
|
+
%tr
|
27
|
+
%th From Status
|
28
|
+
%td= applicant.from_status
|
29
|
+
- elsif applicant.from_category.present?
|
26
30
|
%tr
|
27
31
|
%th From Category
|
28
32
|
%td= applicant.from_category
|