effective_memberships 0.8.2 → 0.8.4

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: d55b0a5c31e8f259614c649af1fe89e2d36cb412652dc6d5ac96f051a925a7ee
4
- data.tar.gz: 3850e9a4d2ba175becb4e0f487bc041c726516d9462470ee6c464a19ece0d559
3
+ metadata.gz: 9f9d47f303cc8f5ebcf269093828d5369969b288673007f98fa7589bd92f3c78
4
+ data.tar.gz: 2b2c1d4f6b31e31cc3e45dfe05a6a6666935a542623b85c2a6072460f7969f96
5
5
  SHA512:
6
- metadata.gz: d6b197509eb8ce44fd7b15230c8b55171eccf2b017017f6e38eb45917453abf96a210118fd25df35d962cf448efc3625db45f1dafe720da32c18d1ee68ab7569
7
- data.tar.gz: 7c2e9ecd43439c7abf4a174ef1adae97938704a941e8338225b3905b38fb0e7d10aae5d075ce169b1140b77f193dc055349751569524163d5a301d65801848cf
6
+ metadata.gz: b7e4b227ffb1bf4798e8d87f7651a14c9d40ba0107c3a58501249380f66475e0ba883d46036958528b077d325722602c69bee535d2a7e90fd0e8714c31f94c07
7
+ data.tar.gz: 64007536a52a3ac533f5b69c122889b3fc804a908da5d7633e1a47bbae6c754cecdb36ea6568abfdefc174a55706134c0aa714c92910bf82154a901aea2730be
@@ -8,9 +8,15 @@ module Admin
8
8
  col :owner_id, visible: false
9
9
  col :owner_type, visible: false
10
10
 
11
- val :owner
12
- col :categories, search: EffectiveMemberships.Category.sorted.map(&:to_s)
13
- col :statuses, search: EffectiveMemberships.Status.sorted.map(&:to_s)
11
+ col :owner
12
+
13
+ col(:categories, search: EffectiveMemberships.Category.sorted, sql_column: true, sort: false).search do |collection, term|
14
+ collection.with_category(EffectiveMemberships.Category.find(term))
15
+ end
16
+
17
+ col(:statuses, search: EffectiveMemberships.Status.sorted, sql_column: true, sort: false).search do |collection, term|
18
+ collection.with_status(EffectiveMemberships.Status.find(term))
19
+ end
14
20
 
15
21
  col :number
16
22
  col :number_as_integer, visible: false
@@ -99,6 +99,7 @@ module EffectiveMembershipsRegistrar
99
99
  end
100
100
 
101
101
  changed = membership.membership_categories.any? { |mc| mc.new_record? || mc.marked_for_destruction? }
102
+ changed ||= membership.membership_statuses.any? { |ms| ms.new_record? || ms.marked_for_destruction? }
102
103
 
103
104
  if changed
104
105
  membership.registration_on = date # Always new registration_on
@@ -27,7 +27,7 @@ module Effective
27
27
  timestamps
28
28
  end
29
29
 
30
- scope :deep, -> { includes(:owner, membership_categories: :category) }
30
+ scope :deep, -> { includes(:owner, membership_categories: :category, membership_statuses: :status) }
31
31
  scope :sorted, -> { order(:id) }
32
32
 
33
33
  scope :with_status, -> (statuses) {
@@ -6,12 +6,15 @@
6
6
  %p You must include #{resource.min_applicant_equivalences} or more equivalent memberships.
7
7
 
8
8
  - if resource.min_applicant_equivalences == 0
9
- %p Equivalent memberships are not required. Click the Remove button to skip adding memberships.
9
+ %p Equivalent memberships are not required.
10
+
11
+ - if resource.applicant_equivalences.blank?
12
+ %p Click Add Another to add an equivalent membership.
10
13
 
11
14
  = effective_form_with(model: resource, url: wizard_path(step), method: :put) do |f|
12
15
  = f.hidden_field :id
13
16
 
14
- = f.has_many(:applicant_equivalences, cards: true) do |aef|
17
+ = f.has_many(:applicant_equivalences, cards: true, build: false) do |aef|
15
18
  %h4.mb-4 Equivalent Membership
16
19
 
17
20
  = aef.text_field :name
@@ -1,3 +1,3 @@
1
1
  module EffectiveMemberships
2
- VERSION = '0.8.2'
2
+ VERSION = '0.8.4'
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.8.2
4
+ version: 0.8.4
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: 2022-10-24 00:00:00.000000000 Z
11
+ date: 2022-11-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails