effective_memberships 0.7.0 → 0.7.1

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: 3972d4221b4931ed7f157f87ef8a7d9c9a1ad785679599a13c3d38e37fd48e56
4
- data.tar.gz: 4a19e5c29db9c7ee41fd67177cda71197adb743f1f4eaaf97116192af82c562b
3
+ metadata.gz: a205c16844097a8874a4f40bda0465c96bd75cbda0ca7505cd74222180891323
4
+ data.tar.gz: f0edcff046181395c697a0c1ce386188dd28d419c7f3c5b9c466f6f9c51b972c
5
5
  SHA512:
6
- metadata.gz: 9b5b013d0f0c7eddfbef6ed4b75c93169bfd4a48eebb07af26bb768d39f57285efb725266b26f6a75f05b14657ddb1ba9490594568b0deb65126caef3b873f99
7
- data.tar.gz: cd37dded19f0ef05190120efe7749a6c0c3e71c5c53b53690c5d5e7e234a8b2b00e12db26480ee3e9f49617c505ca52499254d37b4ebd03c7e0918866e7af6d4
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__, 'Applicant Completed', resource, opts)
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__, 'Applicant Missing Info', resource, opts)
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__, 'Applicant Approved', resource, opts)
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__, 'Applicant Declined', resource, opts)
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 for #{resource.applicant} submitted", resource, opts)
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! All done!"
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! The confidential endorsement has been completed.
2
+ %p Thank you. The confidential endorsement has been completed.
@@ -1,2 +1,2 @@
1
1
  = card do
2
- %p Thank you! The confidential reference has been completed.
2
+ %p Thank you. The confidential reference has been completed.
@@ -2,7 +2,7 @@
2
2
  = render 'effective/applicant_reviews/content', resource: resource
3
3
 
4
4
  = card do
5
- %p Welcome #{current_user}!
5
+ %p Welcome #{current_user}
6
6
 
7
7
  %p You are starting an applicant review for #{resource.applicant}.
8
8
 
@@ -31,4 +31,4 @@
31
31
  %p= link_to 'Pay Fees', effective_memberships.new_fee_payment_path, class: 'btn btn-primary'
32
32
 
33
33
  - else
34
- %p You have no outstanding fees at this time. Thank you!
34
+ %p You have no outstanding fees at this time. Thank you.
@@ -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
 
@@ -1,5 +1,5 @@
1
1
  ---
2
- subject: 'Your application was marked as completed!'
2
+ subject: 'Your application was marked as completed'
3
3
  from: 'admin@example.com'
4
4
  ---
5
5
  Hello {{ user.name }},
@@ -16,4 +16,4 @@ For more details please visit
16
16
 
17
17
  Thanks,
18
18
 
19
- Have a great day!
19
+ Have a great day
@@ -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.
@@ -1,3 +1,3 @@
1
1
  module EffectiveMemberships
2
- VERSION = '0.7.0'
2
+ VERSION = '0.7.1'
3
3
  end
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.0
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