effective_cpd 1.3.1 → 1.3.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/models/concerns/effective_cpd_audit.rb +1 -0
- data/app/models/concerns/effective_cpd_audit_level.rb +4 -0
- data/app/models/concerns/effective_cpd_bulk_audit.rb +2 -2
- data/app/models/concerns/effective_cpd_user.rb +1 -0
- data/app/models/effective/cpd_audit_review_item.rb +3 -2
- data/app/views/admin/cpd_bulk_audits/create.html.haml +12 -0
- data/app/views/effective/cpd_audit_review_items/_fields.html.haml +5 -3
- data/lib/effective_cpd/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fba654344bd04bbe55816f34a8f5598a4c413c753b7de458315c877549e7833a
|
4
|
+
data.tar.gz: afbf52fb5987b51acc284864ee98daf8d97b0b3b2246e6ee88f011b9ad505b74
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 157e522d6b1868bbb86c14aae06a3d2b136d4489a027ad7a9fcab42f3a972efb31ba458a9635d81ef1f1208c0bfc9bd39c4a730aefbb7967db75d2d5952169bf
|
7
|
+
data.tar.gz: d299c09f5bcbe5b0f1e8718fcc54a1e92b52b3183b87079560847fb93e7e209b1219cf65ae2f2cf9d092c190d82a1142f1ce01cb9e138d8c006840faa4604ce3
|
@@ -107,6 +107,7 @@ module EffectiveCpdAudit
|
|
107
107
|
accepts_nested_attributes_for :cpd_audit_responses
|
108
108
|
|
109
109
|
has_many_attached :files
|
110
|
+
has_many_purgable
|
110
111
|
|
111
112
|
effective_resource do
|
112
113
|
due_date :date, permitted: false # Computed due date based on notification and extension date
|
@@ -105,8 +105,8 @@ module EffectiveCpdBulkAudit
|
|
105
105
|
def create_audits!
|
106
106
|
save!
|
107
107
|
|
108
|
-
@auditees = cpd_auditees.
|
109
|
-
@reviewers = cpd_audit_reviewers.
|
108
|
+
@auditees = cpd_auditees.reorder('RANDOM()').limit(audits)
|
109
|
+
@reviewers = cpd_audit_reviewers.reorder('RANDOM()').limit(audits).to_a
|
110
110
|
|
111
111
|
@auditees.each do |auditee|
|
112
112
|
reviewers = audit_reviewers_per_audit.times.map { next_audit_reviewer() }
|
@@ -24,6 +24,7 @@ module EffectiveCpdUser
|
|
24
24
|
has_many :cpd_audits, -> { order(:id) }, inverse_of: :user
|
25
25
|
has_many :cpd_audit_reviews, -> { order(:id) }, inverse_of: :user
|
26
26
|
|
27
|
+
# These two should not be sorted
|
27
28
|
scope :cpd_audit_auditees, -> { without_role(:cpd_audit_reviewer).without_role(:admin) }
|
28
29
|
scope :cpd_audit_reviewers, -> { with_role(:cpd_audit_reviewer) }
|
29
30
|
|
@@ -17,11 +17,12 @@ module Effective
|
|
17
17
|
scope :deep, -> { includes(:cpd_audit_review, :item) }
|
18
18
|
scope :sorted, -> { order(:id) }
|
19
19
|
|
20
|
-
validates :recommendation, presence: true
|
21
20
|
validates :item_id, presence: true, uniqueness: { scope: [:cpd_audit_review_id, :item_type] }
|
22
21
|
|
22
|
+
validates :recommendation, presence: true, if: -> { cpd_audit_review&.cpd_audit_level&.review_item_recommendations.present? }
|
23
|
+
|
23
24
|
validate(if: -> { recommendation.present? && cpd_audit_review.present? }) do
|
24
|
-
unless cpd_audit_review.cpd_audit_level.
|
25
|
+
unless cpd_audit_review.cpd_audit_level.review_item_recommendations.include?(recommendation)
|
25
26
|
self.errors.add(:recommendation, 'must exist in this audit level')
|
26
27
|
end
|
27
28
|
end
|
@@ -0,0 +1,12 @@
|
|
1
|
+
.row
|
2
|
+
.col-md-4
|
3
|
+
.col-md-4
|
4
|
+
= card('All Done') do
|
5
|
+
.alert.alert-success.mb-4 Congratulations! All done!
|
6
|
+
|
7
|
+
%p All selected #{cpd_audits_label} are now being opened.
|
8
|
+
|
9
|
+
%p.text-center
|
10
|
+
= link_to(cpd_audits_label, effective_cpd.admin_cpd_audits_path, class: 'btn btn-primary')
|
11
|
+
|
12
|
+
.col-md-4
|
@@ -1,11 +1,13 @@
|
|
1
1
|
= f.hidden_field :item_id
|
2
2
|
= f.hidden_field :item_type
|
3
3
|
|
4
|
-
- recommendations = cpd_audit_review.cpd_audit_level.
|
4
|
+
- recommendations = cpd_audit_review.cpd_audit_level.review_item_recommendations
|
5
5
|
|
6
|
-
- if recommendations.length
|
6
|
+
- if recommendations.length == 0
|
7
|
+
- # Nothing to do
|
8
|
+
- elsif recommendations.length > 3
|
7
9
|
= f.select :recommendation, recommendations
|
8
10
|
- else
|
9
11
|
= f.radios :recommendation, recommendations, inline: true
|
10
12
|
|
11
|
-
= f.text_area :comments, label: 'Notes'
|
13
|
+
= f.text_area :comments, label: 'Notes', hint: "Not displayed to the #{cpd_auditee_label}"
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: effective_cpd
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.3.
|
4
|
+
version: 1.3.3
|
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-02-
|
11
|
+
date: 2023-02-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -316,6 +316,7 @@ files:
|
|
316
316
|
- app/views/admin/cpd_audits/_status.html.haml
|
317
317
|
- app/views/admin/cpd_bulk_audits/_form.html.haml
|
318
318
|
- app/views/admin/cpd_bulk_audits/_form_cpd_bulk_audit.html.haml
|
319
|
+
- app/views/admin/cpd_bulk_audits/create.html.haml
|
319
320
|
- app/views/admin/cpd_categories/_form.html.haml
|
320
321
|
- app/views/admin/cpd_categories/_form_cpd_category.html.haml
|
321
322
|
- app/views/admin/cpd_cycles/_form.html.haml
|