effective_cpd 0.6.6 → 0.6.7

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: f119fa3686ef62e2b4b785b32f9da5775bb1d809564189cd294a1b018dc3f749
4
- data.tar.gz: 34601ca091deac96e428bebb3d013ea504ec0047413af9baa047fc3199a52201
3
+ metadata.gz: 9f8ab2919547d6a9f2385feb05cd00366bfdf1d4bc8749be2714f2d789249164
4
+ data.tar.gz: 02f0a5a137070f384f19a604b1ff7df6af74e2c420c589306072c5e02a289969
5
5
  SHA512:
6
- metadata.gz: eb27171d3f177bc81cb3831d13902f61402049a8e07889c9e476fa38153007ed734baaa990d7376bd6c318d41de6d39c12588156898165453dc9775477e3dc88
7
- data.tar.gz: e96c06221841c0f35f81459ce7664dd002dfd53d02f30feb4a25b9ebe874f70208736eb2263ee6757cf5a89ca9990cacc8dd4184a485227407e6bad8a91b4521
6
+ metadata.gz: fdb6eb4fea328ded00578d5c16d1e4ed9d46f1560a28c5af53d9fdd3a7ad8675bfe3deb9a8266b0de2a13f37109f22f2fc814850985bf2abaac39070e5b3c592
7
+ data.tar.gz: fd01df0b6f085280c1fc4c8065ba321de5644f765655de4bb0d11b5927c8caf81117a4d1ca50d87338ba0e075669c68a068b23374152ede1536afab78231ddee
@@ -187,10 +187,6 @@ module Effective
187
187
 
188
188
  steps << :conflict if cpd_audit_level.conflict_of_interest?
189
189
 
190
- if conflicted?
191
- return steps + [:waiting, :submit, :complete]
192
- end
193
-
194
190
  steps << :exemption if cpd_audit_level.can_request_exemption?
195
191
 
196
192
  unless exemption_requested?
@@ -238,20 +234,13 @@ module Effective
238
234
  started!
239
235
  end
240
236
 
241
- # Auditee wizard action
242
- def conflict!
243
- return started! unless conflict_of_interest?
244
-
245
- update!(status: :conflicted)
246
- send_email(:cpd_audit_conflicted)
247
- end
248
-
249
237
  # Admin action
250
238
  def resolve_conflict!
251
239
  wizard_steps[:conflict] = nil # Have them complete the conflict step again.
252
240
 
253
241
  assign_attributes(conflict_of_interest: false, conflict_of_interest_reason: nil)
254
242
  conflicted_resolved!
243
+ submitted!
255
244
 
256
245
  send_email(:cpd_audit_conflict_resolved)
257
246
  true
@@ -340,9 +329,17 @@ module Effective
340
329
 
341
330
  # Auditee wizard action
342
331
  def submit!
343
- submitted!
344
- cpd_audit_reviews.each { |cpd_audit_review| cpd_audit_review.ready! }
345
- send_email(:cpd_audit_submitted)
332
+ if conflict_of_interest?
333
+ conflicted!
334
+ send_email(:cpd_audit_conflicted)
335
+ else
336
+ submitted!
337
+
338
+ cpd_audit_reviews.each { |cpd_audit_review| cpd_audit_review.ready! }
339
+ send_email(:cpd_audit_submitted)
340
+ end
341
+
342
+ true
346
343
  end
347
344
 
348
345
  # Called in a before_save. Intended for applicant_review to call in its submit! method
@@ -1,5 +1,5 @@
1
1
  = render('layout') do
2
- - raise('expected a submitted cpd_audit') unless resource.was_submitted? || resource.closed?
2
+ - raise('expected a submitted or conflicted cpd_audit') unless (resource.was_submitted? || resource.was_conflicted? || resource.closed?)
3
3
 
4
4
  - if resource.was_submitted?
5
5
  .text-center
@@ -20,4 +20,6 @@
20
20
  = f.show_if :conflict_of_interest, false do
21
21
  = f.hidden_field :conflict_of_interest_reason, value: ''
22
22
 
23
+ %p A new auditor will be selected if there is a conflict of interest.
24
+
23
25
  = f.submit 'Save and Continue', center: true
@@ -1,3 +1,3 @@
1
1
  module EffectiveCpd
2
- VERSION = '0.6.6'
2
+ VERSION = '0.6.7'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: effective_cpd
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.6
4
+ version: 0.6.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Code and Effect