effective_memberships 0.6.12 → 0.6.13

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: f653de8b05ce80ba04ef7753b66ba37f3e4e47c1e5716bcc35ce309aa8202df0
4
- data.tar.gz: c57dbe090a81aac7c96ba2050143e23d9cdc30ea9af601495be96142cf4a430f
3
+ metadata.gz: 58da6947ec96b076bd125a190e31ade30e7964b6dc796423dc7387efa156a246
4
+ data.tar.gz: 5805aa420a911f2abbb4d38ceaf1d6d743a3932e3b47a14b3b1e4a8796afd0bd
5
5
  SHA512:
6
- metadata.gz: bff3a9c5f5a68e5725b7c2d3e2d427fd8deb9282fed0863554a62be18c6215d7ddb7eaea72d172ab4d62cf81eb2f763766cde06177b71fb4b01cf2f264b7e399
7
- data.tar.gz: 7d3e1041de63cbcca640c12d6f0305211d9142316a7da0c83edf4286ed1776fa16bc36a332d46a09895c4806acccda01c13f4ea7c150fce2cddc968719862e49
6
+ metadata.gz: ea84383f2dbd0763c31e4c8a1c13f16d474d96e749502717dec4825cdbd50eee9fe3dbf3572650dcccedc3f05785bc283c0451fd9ac51fee5f17fd7fa738e7b6
7
+ data.tar.gz: f0d0dad74b75782b25fc76f786b6e1d042faa591941ebc747ac85d24301dda54e8d3fc5be080ef5827ac251de0f60d23eafea443106565fb872fd2ccdb9bf1a6
@@ -292,6 +292,21 @@ module EffectiveMembershipsApplicant
292
292
 
293
293
  self.errors.add(:applicant_endorsements, "please include #{required} or more endorsements") if existing < required
294
294
  end
295
+
296
+ validate do
297
+ endorsements = applicant_endorsements().reject(&:marked_for_destruction?)
298
+
299
+ duplicates = endorsements.select do |endorsement|
300
+ (endorsements - [endorsement]).find do |existing|
301
+ (endorsement.endorser.present? && endorsement.endorser == existing.endorser)
302
+ end.present?
303
+ end
304
+
305
+ if duplicates.present?
306
+ self.errors.add(:applicant_endorsements, "cannot use the same endorser more than once")
307
+ duplicates.each { |dup| dup.errors.add(:endorser_id, "has already been included") }
308
+ end
309
+ end
295
310
  end
296
311
 
297
312
  # Applicant Equivalences Step
@@ -51,6 +51,6 @@
51
51
  = tab 'Other Applications' do
52
52
  = render_datatable(Admin::EffectiveApplicantsDatatable.new(user: applicant.owner, except_id: applicant.id))
53
53
 
54
- - if applicant.persisted? && applicant.respond_to?(:log_changes_datatable)
54
+ - if applicant.persisted? && applicant.respond_to?(:logs_datatable)
55
55
  = tab 'Logs' do
56
- = render_inline_datatable(applicant.log_changes_datatable)
56
+ = render_datatable(applicant.logs_datatable, inline: true, namespace: :admin)
@@ -29,7 +29,7 @@
29
29
  %td
30
30
  Joined on #{membership.joined_on.strftime('%F')}
31
31
  - if membership.reregistered?
32
- and last changed on #{membership.reregistered_on.strftime('%F')}
32
+ and last changed on #{membership.registration_on.strftime('%F')}
33
33
 
34
34
  = collapse('show more', card_class: '') do
35
35
  %p #{applicant.owner} membership history
@@ -1,3 +1,3 @@
1
1
  module EffectiveMemberships
2
- VERSION = '0.6.12'
2
+ VERSION = '0.6.13'
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.12
4
+ version: 0.6.13
5
5
  platform: ruby
6
6
  authors:
7
7
  - Code and Effect