effective_memberships 0.17.3 → 0.17.5

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: 172faa35356355bd3a8d6f2bd51a4d1ec26cac9b58c617713b972096c32ec42d
4
- data.tar.gz: fa370c75fcf09fd03134451dc3ffeefb3bd3b0b9032392fb4e9a17c364f810a0
3
+ metadata.gz: ef70771a4a2a9d5a9664b76dda457120845bd43ead1b684af0d71a8560331cb6
4
+ data.tar.gz: 585c057a19577bf1f5e4c6abca5e62fe7d55131090dcaa3f0839573b4e3a7bb0
5
5
  SHA512:
6
- metadata.gz: 1853d32c2a951cc21b34ee224007bed5ca1af849027f3ac398cd99a77c9397e4cc8cce59ba7e26c23ffd4cb006676933a7a208a95b2c55a9f3b48ff0b6218db8
7
- data.tar.gz: a5a8f725ca25361aa8424108fc59c4aff507367a895c0f99f94ecdbce30117a6d77049facf8ba255fdacef68a555c5c87172f8c72ca1bc1304f4183fe66362f2
6
+ metadata.gz: 5f0e3096d63739c7d5e9e4de4c82c5876e8f2b70bd9ce297c23aa71fc54a302d19c7c31c3ba9e64bd53469d1e7e7f44f4afb8bf0529125bc3d9da58b6092852c
7
+ data.tar.gz: d1b95965cc3993a43f94273802aa8f7199d5107508be1858217a28644ab0fa3df48c003bd47352eef38be325ab1713398de15b2871de1d72f44ec98b526bbb85
@@ -432,6 +432,13 @@ module EffectiveMembershipsOwner
432
432
  history
433
433
  end
434
434
 
435
+ def membership_category_start_on(category: :current)
436
+ category = membership&.categories&.first if category == :current
437
+ raise('expected a category') unless category.present?
438
+
439
+ membership_histories.find { |history| history.membership_category_ids.include?(category.id) }&.start_on || membership&.joined_on
440
+ end
441
+
435
442
  def membership_history_on(date)
436
443
  raise('expected a date') unless date.respond_to?(:strftime)
437
444
  membership_histories.find { |history| (history.start_on..history.end_on).cover?(date) } # Ruby 2.6 supports endless ranges
@@ -103,6 +103,7 @@ module EffectiveMembershipsRegistrar
103
103
  end
104
104
 
105
105
  # This is only used for a form collection on admin memberships
106
+ # And now for ASPB applicant reinstatement fees
106
107
  def periods(from:, to: nil)
107
108
  to ||= Time.zone.now
108
109
 
@@ -69,5 +69,13 @@ module Effective
69
69
  assign_attributes(statuses: statuses.map(&:to_s), status_ids: statuses.map(&:id))
70
70
  end
71
71
 
72
+ def start_period
73
+ EffectiveMemberships.Registrar.period(date: start_on)
74
+ end
75
+
76
+ def end_period
77
+ EffectiveMemberships.Registrar.period(date: end_on)
78
+ end
79
+
72
80
  end
73
81
  end
@@ -10,8 +10,7 @@
10
10
  .row.mt-4
11
11
  - group.each do |membership|
12
12
  .col-md
13
- - next unless membership
14
- = render('effective/membership_directory/membership', membership: membership)
13
+ = render('effective/membership_directory/membership', membership: membership) if membership
15
14
 
16
15
  %nav.d-flex.justify-content-center
17
16
  = bootstrap_paginate(results, per_page: membership_directory.per_page)
@@ -1,26 +1,6 @@
1
1
  = render 'layout' do
2
2
  .effective-membership
3
-
4
- %h6= @membership.owner
5
- %p= @membership.categories.map(&:membership_directory_title).to_sentence
6
- %p= @membership.statuses.map(&:membership_directory_title).to_sentence
7
- %p= @membership.number
8
-
9
- - if @membership.owner.respond_to?(:rich_text_body)
10
- .mb-4= @membership.owner.rich_text_body.to_s
11
-
12
- - if @membership.owner.try(:email).present?
13
- %p= reveal_mail_to(@membership.owner.email)
14
-
15
- - if (organizations = @membership.owner.try(:membership_organizations)).present?
16
- .mb-4.membership-directory-organizations
17
- - organizations.each do |organization|
18
- %div= organization
19
-
20
- - if (users = @membership.owner.try(:membership_users)).present?
21
- .mb-4.membership-directory-users
22
- - users.each do |user|
23
- %div= user
3
+ = render('effective/membership_directory/membership', membership: @membership)
24
4
 
25
5
  %hr
26
6
  = link_to 'Return to Directory', effective_memberships.membership_directory_index_path, class: 'btn btn-primary'
@@ -1,3 +1,3 @@
1
1
  module EffectiveMemberships
2
- VERSION = '0.17.3'
2
+ VERSION = '0.17.5'
3
3
  end
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.3
4
+ version: 0.17.5
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-05-05 00:00:00.000000000 Z
11
+ date: 2023-05-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -574,7 +574,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
574
574
  - !ruby/object:Gem::Version
575
575
  version: '0'
576
576
  requirements: []
577
- rubygems_version: 3.0.8
577
+ rubygems_version: 3.1.2
578
578
  signing_key:
579
579
  specification_version: 4
580
580
  summary: Manage your professional association online. Membership categories, applications