effective_memberships 0.6.10 → 0.6.11

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7ba47cb79fdfe1d53bfa440e0c6ecd4b454f7da034a9035d25e0306e0b57a1d9
4
- data.tar.gz: 7b342075e2d9aa6e51d7cecd34011e491f1c95ae7123606d26a23b128915e34d
3
+ metadata.gz: d38d7c30fe73cb0b97797cad055c8c4d92b5ea509f7d3f9a2df8b2f47692b485
4
+ data.tar.gz: bb62d7035ddfbe41cfe2824c4a045e0f9481cf0bc9533b7bec0beb982a797419
5
5
  SHA512:
6
- metadata.gz: 4033eb84334a81fe60aa6b67248f34feec629ca3a83bb6f0725ef2bb013dce6344b629eefd9f940f8a6f2b3a7dbdf35360b4027b925c5785d7e1ab7d359b0dcd
7
- data.tar.gz: 59978379131bfb1a4e9988fdeda03e8e792ec37011c1c2a7338072c73c743dd1cd33999be0d1cbb41142e60ca43e1c15e8fe053b56a7ac9ffcc96e9e6ed6aa6d
6
+ metadata.gz: a4251303f22271a28b46f12111888338949949d076956df8fde66a3cf8e70c383eeeef557860073d6aeb7e88b5a9f0e686fbb6af00b84b795c61394bc1c6a2fe
7
+ data.tar.gz: f9a694918489449dfc6d020320256342ac9a2455df74cade89dc6ef3042535bea5be68b034fc2cabda4ece0b7587c32ccba932d7b4c16a92565fd70f030b0286
@@ -38,7 +38,7 @@ module Admin
38
38
  col :bad_standing
39
39
  col :removed
40
40
 
41
- actions_col
41
+ actions_col unless attributes[:actions] == false
42
42
  end
43
43
 
44
44
  collection do
@@ -76,4 +76,13 @@ module EffectiveMembershipsUser
76
76
  organizations.select { |organization| organization.is?(:member) && !organization.archived? }
77
77
  end
78
78
 
79
+ def membership_history_on(date)
80
+ raise('expected a date') unless date.respond_to?(:strftime)
81
+ membership_histories.find { |history| (history.start_on..history.end_on).cover?(date) } # Ruby 2.6 supports endless ranges
82
+ end
83
+
84
+ def membership_categories_on(date)
85
+ membership_history_on(date).try(:membership_categories)
86
+ end
87
+
79
88
  end
@@ -163,6 +163,10 @@ module Effective
163
163
  membership_status(status: status) || membership_statuses.build(status: status)
164
164
  end
165
165
 
166
+ def reregistered?
167
+ registration_on.present? && joined_on.present? && registration_on > joined_on
168
+ end
169
+
166
170
  def good_standing?
167
171
  !bad_standing?
168
172
  end
@@ -22,11 +22,25 @@
22
22
  - else
23
23
  None
24
24
 
25
+ - if request.path.start_with?('/admin')
26
+ - if (membership = applicant.owner.membership).present?
27
+ %tr
28
+ %th Membership
29
+ %td
30
+ Joined on #{membership.joined_on.strftime('%F')}
31
+ - if membership.reregistered?
32
+ and last changed on #{membership.reregistered_on.strftime('%F')}
33
+
34
+ = collapse('show more', card_class: '') do
35
+ %p #{applicant.owner} membership history
36
+ = render_datatable(Admin::EffectiveMembershipHistoriesDatatable.new(owner: applicant.owner, actions: false), simple: true)
37
+
25
38
  - if applicant.from_status.present?
26
39
  %tr
27
40
  %th From Status
28
41
  %td= applicant.from_status
29
- - elsif applicant.from_category.present?
42
+
43
+ - if applicant.from_category.present?
30
44
  %tr
31
45
  %th From Category
32
46
  %td= applicant.from_category
@@ -1,3 +1,3 @@
1
1
  module EffectiveMemberships
2
- VERSION = '0.6.10'
2
+ VERSION = '0.6.11'
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.6.10
4
+ version: 0.6.11
5
5
  platform: ruby
6
6
  authors:
7
7
  - Code and Effect