effective_memberships 0.17.8 → 0.17.10
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/models/concerns/effective_memberships_applicant.rb +1 -2
- data/app/models/concerns/effective_memberships_applicant_review.rb +10 -0
- data/app/models/effective/applicant_reference.rb +15 -0
- data/app/models/effective/membership.rb +19 -0
- data/app/models/effective/membership_history.rb +11 -0
- data/app/views/admin/applicants/_form_approve.html.haml +2 -2
- data/lib/effective_memberships/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1ce6118d2ee3305019612e18f63990abffeca7345b0f55b420a500b76f3fcb1c
|
4
|
+
data.tar.gz: cc0dd908ae8d05fd5f53038b67be0744cf045edf76f613fccc5f5d4d889db44f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 889c672b4c30ff42b47faa11f0dbe5bd1e1c4e816eeaa100798482f01fca5f06dc3565ef63fed7c86a26bf4f929d4e5895865c5f4b0f76646fa20e0cec4ea3f3
|
7
|
+
data.tar.gz: bfc6d2f12222988da2b3017ca52315da6580279da29ff1a02d887e2b0b55a270c1928d43a4e7dbd84dd037dc3670c2766b2b37bd1847ef7666c4f6f4b83cd48a
|
@@ -192,7 +192,7 @@ module EffectiveMembershipsApplicant
|
|
192
192
|
|
193
193
|
# effective_reports
|
194
194
|
def reportable_scopes
|
195
|
-
{ draft: nil, submitted: nil, in_progress: nil, done: nil }
|
195
|
+
{ draft: nil, submitted: nil, missing_info: nil, completed: nil, reviewed: nil, declined: nil, approved: nil, in_progress: nil, done: nil }
|
196
196
|
end
|
197
197
|
|
198
198
|
scope :deep, -> { includes(:user, :organization, :category, :from_category, :from_status, :orders) }
|
@@ -202,7 +202,6 @@ module EffectiveMembershipsApplicant
|
|
202
202
|
scope :done, -> { where(status: [:approved, :declined]) }
|
203
203
|
|
204
204
|
scope :not_draft, -> { where.not(status: :draft) }
|
205
|
-
|
206
205
|
scope :reviewable, -> { where.not(status: [:draft, :submitted, :declined, :approved]) }
|
207
206
|
|
208
207
|
scope :for, -> (user) {
|
@@ -29,6 +29,7 @@ module EffectiveMembershipsApplicantReview
|
|
29
29
|
|
30
30
|
included do
|
31
31
|
log_changes(to: :applicant) if respond_to?(:log_changes)
|
32
|
+
acts_as_reportable if respond_to?(:acts_as_reportable)
|
32
33
|
|
33
34
|
acts_as_tokened
|
34
35
|
|
@@ -59,6 +60,15 @@ module EffectiveMembershipsApplicantReview
|
|
59
60
|
timestamps
|
60
61
|
end
|
61
62
|
|
63
|
+
# effective_reports
|
64
|
+
def reportable_scopes
|
65
|
+
{ in_progress: nil, done: nil }
|
66
|
+
end
|
67
|
+
|
68
|
+
def reportable_email
|
69
|
+
reviewer.try(:email)
|
70
|
+
end
|
71
|
+
|
62
72
|
scope :deep, -> { includes(:reviewer, applicant: [:user, :applicant_reviews]) }
|
63
73
|
|
64
74
|
scope :for, -> (user) {
|
@@ -11,6 +11,7 @@ module Effective
|
|
11
11
|
)
|
12
12
|
|
13
13
|
log_changes(to: :applicant) if respond_to?(:log_changes)
|
14
|
+
acts_as_reportable if respond_to?(:acts_as_reportable)
|
14
15
|
|
15
16
|
belongs_to :applicant, polymorphic: true, optional: true
|
16
17
|
|
@@ -52,6 +53,20 @@ module Effective
|
|
52
53
|
timestamps
|
53
54
|
end
|
54
55
|
|
56
|
+
# effective_reports
|
57
|
+
def reportable_scopes
|
58
|
+
{ in_progress: nil, done: nil, expired: nil }
|
59
|
+
end
|
60
|
+
|
61
|
+
scope :in_progress, -> { with_submitted_applicants.where(status: :submitted) }
|
62
|
+
scope :done, -> { where(status: :completed) }
|
63
|
+
|
64
|
+
scope :expired, -> { where(status: :submitted).where.not(with_submitted_applicants) }
|
65
|
+
|
66
|
+
scope :with_submitted_applicants, -> {
|
67
|
+
where(applicant_id: EffectiveMemberships.Applicant.submitted)
|
68
|
+
}
|
69
|
+
|
55
70
|
scope :deep, -> { all }
|
56
71
|
|
57
72
|
# All step validations
|
@@ -11,6 +11,7 @@ module Effective
|
|
11
11
|
has_many :membership_statuses, -> { order(:id) }, inverse_of: :membership, dependent: :delete_all
|
12
12
|
accepts_nested_attributes_for :membership_statuses
|
13
13
|
|
14
|
+
acts_as_reportable if respond_to?(:acts_as_reportable)
|
14
15
|
log_changes(to: :owner) if respond_to?(:log_changes)
|
15
16
|
|
16
17
|
effective_resource do
|
@@ -35,7 +36,23 @@ module Effective
|
|
35
36
|
scope :deep, -> { includes(:owner, membership_categories: :category, membership_statuses: :status) }
|
36
37
|
scope :sorted, -> { order('lower(owner_name)') }
|
37
38
|
|
39
|
+
# effective_reports
|
40
|
+
def reportable_scopes
|
41
|
+
{
|
42
|
+
with_category: :string,
|
43
|
+
with_status: :string,
|
44
|
+
joined_before: :date,
|
45
|
+
joined_after: :date,
|
46
|
+
with_paid_fees_through: :date,
|
47
|
+
with_unpaid_fees_through: :date,
|
48
|
+
in_good_standing: nil,
|
49
|
+
not_in_good_standing: nil
|
50
|
+
}
|
51
|
+
end
|
52
|
+
|
38
53
|
scope :with_status, -> (statuses) {
|
54
|
+
statuses = Resource.new(EffectiveMemberships.Status).search_any(statuses) if statuses.kind_of?(String)
|
55
|
+
|
39
56
|
raise('expected an EffectiveMemberships.Status') unless statuses.class.respond_to?(:effective_memberships_status?) || Array(statuses).all? { |status| status.kind_of?(EffectiveMemberships.Status) }
|
40
57
|
where(id: MembershipStatus.where(status_id: statuses).select(:membership_id))
|
41
58
|
}
|
@@ -46,6 +63,8 @@ module Effective
|
|
46
63
|
}
|
47
64
|
|
48
65
|
scope :with_category, -> (categories) {
|
66
|
+
categories = Resource.new(EffectiveMemberships.Category).search_any(categories) if categories.kind_of?(String)
|
67
|
+
|
49
68
|
raise('expected an EffectiveMemberships.Category') unless categories.class.respond_to?(:effective_memberships_category?) || Array(categories).all? { |cat| cat.kind_of?(EffectiveMemberships.Category) }
|
50
69
|
where(id: MembershipCategory.where(category_id: categories).select(:membership_id))
|
51
70
|
}
|
@@ -2,6 +2,8 @@ module Effective
|
|
2
2
|
class MembershipHistory < ActiveRecord::Base
|
3
3
|
belongs_to :owner, polymorphic: true
|
4
4
|
|
5
|
+
acts_as_reportable if respond_to?(:acts_as_reportable)
|
6
|
+
|
5
7
|
effective_resource do
|
6
8
|
start_on :date
|
7
9
|
end_on :date
|
@@ -13,6 +15,9 @@ module Effective
|
|
13
15
|
categories :text
|
14
16
|
category_ids :text
|
15
17
|
|
18
|
+
statuses :text
|
19
|
+
status_ids :text
|
20
|
+
|
16
21
|
notes :text
|
17
22
|
|
18
23
|
timestamps
|
@@ -27,9 +32,15 @@ module Effective
|
|
27
32
|
serialize :statuses, Array
|
28
33
|
serialize :status_ids, Array
|
29
34
|
|
35
|
+
# effective_reports
|
36
|
+
def reportable_scopes
|
37
|
+
{ removed: nil, not_removed: nil }
|
38
|
+
end
|
39
|
+
|
30
40
|
scope :deep, -> { includes(:owner) }
|
31
41
|
scope :sorted, -> { order(:start_on).order(:id) }
|
32
42
|
|
43
|
+
scope :not_removed, -> { where(removed: false) }
|
33
44
|
scope :removed, -> { where(removed: true) }
|
34
45
|
|
35
46
|
validates :owner, presence: true
|
@@ -5,14 +5,14 @@
|
|
5
5
|
%p The #{applicant} will be <strong>approved</strong>
|
6
6
|
%p Their membership will be removed and they will be marked as resigned.
|
7
7
|
|
8
|
-
- elsif f.object.reinstatement?
|
8
|
+
- elsif f.object.reinstatement? && applicant.owner.reinstatement_membership_history.present?
|
9
9
|
- reinstatement = applicant.owner.reinstatement_membership_history
|
10
10
|
|
11
11
|
%p The #{applicant} will be <strong>approved</strong>
|
12
12
|
%p Their membership will be reinstated and they will regain the following category, number and status:
|
13
13
|
|
14
14
|
%ul
|
15
|
-
%li Category: #{reinstatement.membership_categories.to_sentence}
|
15
|
+
%li Category: #{reinstatement.membership_categories.try(:to_sentence)}
|
16
16
|
%li Number: #{reinstatement.number}
|
17
17
|
%li Status: #{badges(reinstatement.membership_statuses).presence || 'None'}
|
18
18
|
|
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.17.
|
4
|
+
version: 0.17.10
|
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-
|
11
|
+
date: 2023-06-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -577,7 +577,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
577
577
|
- !ruby/object:Gem::Version
|
578
578
|
version: '0'
|
579
579
|
requirements: []
|
580
|
-
rubygems_version: 3.
|
580
|
+
rubygems_version: 3.4.10
|
581
581
|
signing_key:
|
582
582
|
specification_version: 4
|
583
583
|
summary: Manage your professional association online. Membership categories, applications
|