effective_memberships 0.7.0 → 0.7.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/mailers/effective/memberships_mailer.rb +15 -5
- data/app/models/concerns/effective_memberships_applicant.rb +3 -1
- data/app/models/concerns/effective_memberships_owner.rb +19 -0
- data/app/models/effective/membership.rb +3 -0
- data/app/views/effective/applicant_endorsements/complete.html.haml +1 -1
- data/app/views/effective/applicant_references/complete.html.haml +1 -1
- data/app/views/effective/applicant_reviews/start.html.haml +1 -1
- data/app/views/effective/fees/_dashboard.html.haml +1 -1
- data/app/views/effective/memberships_mailer/applicant_approved.liquid +2 -2
- data/app/views/effective/memberships_mailer/applicant_completed.liquid +1 -1
- data/app/views/effective/memberships_mailer/applicant_review_submitted.liquid +1 -1
- data/app/views/effective/memberships_mailer/applicant_submitted.liquid +15 -0
- data/lib/effective_memberships/version.rb +1 -1
- metadata +2 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a205c16844097a8874a4f40bda0465c96bd75cbda0ca7505cd74222180891323
|
4
|
+
data.tar.gz: f0edcff046181395c697a0c1ce386188dd28d419c7f3c5b9c466f6f9c51b972c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d2abc588db28def44fbebc89138443c1de6e4cfba9654b2e0b93d2d399eca177b3ce0da51a0a62ac50dea6585518459609bc3a7749061719f9ea5f2c3572dfd2
|
7
|
+
data.tar.gz: 37e0ca136d376fba18e6d84eba56289a81c17c7da9268aaab10c415b78aecc5f83c256dd1a9eb43a4d4c362491b8deaf0223a711fcdf957007ccca463728c1d0
|
@@ -4,11 +4,21 @@ module Effective
|
|
4
4
|
include EffectiveMailer
|
5
5
|
include EffectiveEmailTemplatesMailer if EffectiveMemberships.use_effective_email_templates
|
6
6
|
|
7
|
+
def applicant_submitted(resource, opts = {})
|
8
|
+
@assigns = assigns_for(resource)
|
9
|
+
@applicant = resource
|
10
|
+
|
11
|
+
subject = subject_for(__method__, "Applicant Submitted - #{resource}", resource, opts)
|
12
|
+
headers = headers_for(resource, opts)
|
13
|
+
|
14
|
+
mail(to: resource.user.email, subject: subject, **headers)
|
15
|
+
end
|
16
|
+
|
7
17
|
def applicant_completed(resource, opts = {})
|
8
18
|
@assigns = assigns_for(resource)
|
9
19
|
@applicant = resource
|
10
20
|
|
11
|
-
subject = subject_for(__method__,
|
21
|
+
subject = subject_for(__method__, "Applicant Completed - #{resource}", resource, opts)
|
12
22
|
headers = headers_for(resource, opts)
|
13
23
|
|
14
24
|
mail(to: resource.user.email, subject: subject, **headers)
|
@@ -18,7 +28,7 @@ module Effective
|
|
18
28
|
@assigns = assigns_for(resource)
|
19
29
|
@applicant = resource
|
20
30
|
|
21
|
-
subject = subject_for(__method__,
|
31
|
+
subject = subject_for(__method__, "Applicant Missing Info - #{resource}", resource, opts)
|
22
32
|
headers = headers_for(resource, opts)
|
23
33
|
|
24
34
|
mail(to: resource.user.email, subject: subject, **headers)
|
@@ -28,7 +38,7 @@ module Effective
|
|
28
38
|
@assigns = assigns_for(resource)
|
29
39
|
@applicant = resource
|
30
40
|
|
31
|
-
subject = subject_for(__method__,
|
41
|
+
subject = subject_for(__method__, "Applicant Approved - #{resource}", resource, opts)
|
32
42
|
headers = headers_for(resource, opts)
|
33
43
|
|
34
44
|
mail(to: resource.user.email, subject: subject, **headers)
|
@@ -38,7 +48,7 @@ module Effective
|
|
38
48
|
@assigns = assigns_for(resource)
|
39
49
|
@applicant = resource
|
40
50
|
|
41
|
-
subject = subject_for(__method__,
|
51
|
+
subject = subject_for(__method__, "Applicant Declined - #{resource}", resource, opts)
|
42
52
|
headers = headers_for(resource, opts)
|
43
53
|
|
44
54
|
mail(to: resource.user.email, subject: subject, **headers)
|
@@ -69,7 +79,7 @@ module Effective
|
|
69
79
|
@applicant_review = resource
|
70
80
|
@applicant = resource.applicant
|
71
81
|
|
72
|
-
subject = subject_for(__method__, "Applicant Review
|
82
|
+
subject = subject_for(__method__, "Applicant Review Submitted - #{resource.applicant}", resource, opts)
|
73
83
|
headers = headers_for(resource, opts)
|
74
84
|
|
75
85
|
mail(to: mailer_admin, subject: subject, **headers)
|
@@ -490,6 +490,8 @@ module EffectiveMembershipsApplicant
|
|
490
490
|
stamps.each { |stamp| stamp.submit! }
|
491
491
|
|
492
492
|
after_commit do
|
493
|
+
send_email(:applicant_submitted)
|
494
|
+
|
493
495
|
applicant_endorsements.each { |endorsement| endorsement.notify! if endorsement.submitted? }
|
494
496
|
applicant_references.each { |reference| reference.notify! if reference.submitted? }
|
495
497
|
end
|
@@ -571,7 +573,7 @@ module EffectiveMembershipsApplicant
|
|
571
573
|
when 'reviewed'
|
572
574
|
"This application has been reviewed and is now ready for an admin to approve or decline it. If approved, prorated fees will be generated."
|
573
575
|
when 'approved'
|
574
|
-
"The application has been approved
|
576
|
+
"The application has been approved. All done."
|
575
577
|
when 'declined'
|
576
578
|
"This application has been declined."
|
577
579
|
else
|
@@ -43,6 +43,11 @@ module EffectiveMembershipsOwner
|
|
43
43
|
without_role(:member).where(id: removed.select(:owner_id))
|
44
44
|
}
|
45
45
|
|
46
|
+
scope :membership_good_standing, -> {
|
47
|
+
bad_standing = Effective::Membership.where(bad_standing: false).where(owner_type: name)
|
48
|
+
where(id: bad_standing.select(:owner_id))
|
49
|
+
}
|
50
|
+
|
46
51
|
scope :membership_bad_standing, -> {
|
47
52
|
bad_standing = Effective::Membership.where(bad_standing: true).where(owner_type: name)
|
48
53
|
where(id: bad_standing.select(:owner_id))
|
@@ -71,6 +76,20 @@ module EffectiveMembershipsOwner
|
|
71
76
|
where(id: memberships.where(owner_type: name).select(:owner_id))
|
72
77
|
}
|
73
78
|
|
79
|
+
scope :membership_joined_before, -> (date) {
|
80
|
+
raise('expected a date') unless date.respond_to?(:strftime)
|
81
|
+
|
82
|
+
joined_before = Effective::Membership.joined_before(date).where(owner_type: name)
|
83
|
+
where(id: joined_before.select(:owner_id))
|
84
|
+
}
|
85
|
+
|
86
|
+
scope :membership_joined_after, -> (date) {
|
87
|
+
raise('expected a date') unless date.respond_to?(:strftime)
|
88
|
+
|
89
|
+
joined_after = Effective::Membership.joined_after(date).where(owner_type: name)
|
90
|
+
where(id: joined_after.select(:owner_id))
|
91
|
+
}
|
92
|
+
|
74
93
|
end
|
75
94
|
|
76
95
|
def assign_member_role
|
@@ -36,6 +36,9 @@ module Effective
|
|
36
36
|
|
37
37
|
scope :good_standing, -> { where(bad_standing: [nil, false]) }
|
38
38
|
|
39
|
+
scope :joined_before, -> (date) { where(arel_table[:joined_on].lt(date)) }
|
40
|
+
scope :joined_after, -> (date) { where(arel_table[:joined_on].gteq(date)) }
|
41
|
+
|
39
42
|
scope :with_paid_fees_through, -> (period = nil) {
|
40
43
|
where(arel_table[:fees_paid_period].gteq(period || EffectiveMemberships.Registrar.current_period))
|
41
44
|
}
|
@@ -1,2 +1,2 @@
|
|
1
1
|
= card do
|
2
|
-
%p Thank you
|
2
|
+
%p Thank you. The confidential endorsement has been completed.
|
@@ -1,2 +1,2 @@
|
|
1
1
|
= card do
|
2
|
-
%p Thank you
|
2
|
+
%p Thank you. The confidential reference has been completed.
|
@@ -1,10 +1,10 @@
|
|
1
1
|
---
|
2
|
-
subject: 'Your application was approved
|
2
|
+
subject: 'Your application was approved'
|
3
3
|
from: 'admin@example.com'
|
4
4
|
---
|
5
5
|
Hello {{ user.name }},
|
6
6
|
|
7
|
-
Your application for {{ applicant.to_category }} was approved
|
7
|
+
Your application for {{ applicant.to_category }} was approved.
|
8
8
|
|
9
9
|
Please log in and purchase any outstanding fees.
|
10
10
|
|
@@ -0,0 +1,15 @@
|
|
1
|
+
---
|
2
|
+
subject: 'Your application was successfully submitted'
|
3
|
+
from: 'admin@example.com'
|
4
|
+
---
|
5
|
+
Hello {{ user.name }},
|
6
|
+
|
7
|
+
We have received your application for {{ applicant.to_category }} #{{ applicant.to_status }}
|
8
|
+
|
9
|
+
For more details please visit
|
10
|
+
|
11
|
+
{{ applicant.url }}
|
12
|
+
|
13
|
+
Thank you.
|
14
|
+
|
15
|
+
Please contact us for assistance.
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: effective_memberships
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.7.
|
4
|
+
version: 0.7.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Code and Effect
|
@@ -487,6 +487,7 @@ files:
|
|
487
487
|
- app/views/effective/memberships_mailer/applicant_missing_info.liquid
|
488
488
|
- app/views/effective/memberships_mailer/applicant_reference_notification.liquid
|
489
489
|
- app/views/effective/memberships_mailer/applicant_review_submitted.liquid
|
490
|
+
- app/views/effective/memberships_mailer/applicant_submitted.liquid
|
490
491
|
- app/views/effective/organizations/_dashboard.html.haml
|
491
492
|
- app/views/effective/organizations/_form.html.haml
|
492
493
|
- app/views/effective/organizations/_form_organization.html.haml
|