effective_cpd 0.1.12 → 0.1.16

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: cde9eaf26a9942cdb7c819292ccd1613563d5dad01bd0f15c751e92b9779a90f
4
- data.tar.gz: 4871cc82d92fbd1280fabc31a914a0e92d5c07f66e98bfae183da5de203deeed
3
+ metadata.gz: 30c4b5c729e67d3ad63505d91bf53b705cd0fff7b6af6fc227857fee4f525fcd
4
+ data.tar.gz: 3a5602f9711251984c723d5042cb15fdadc064ed40d38e3fcc83389c6e1a04c7
5
5
  SHA512:
6
- metadata.gz: 588c74b697e23bd1172f7ea9001a04771ea9c0a609fd90d43c4f446b7986d0d229e0d558b7154e0d8ccd7c7ec1492abb3389346725955b073ab3765523dbb038
7
- data.tar.gz: 7310fd2ca81076bd23eddd5d9f276f685b6d479857123fd7799cd16719d30170b659578eb4cc681caf659bef8435bc1f07b2dfe1d5b837a0f23673183ed1a746
6
+ metadata.gz: 7efa6a61be4d0fca14becac4296a21b4375a6ce71c2350f3a8b380733bfdbabe1482dc22012bc11c5e9f4a464b13666dd77447fecb37918506d387b7402b4f9b
7
+ data.tar.gz: 8f6d6564d6c6eb0bd6fced0f9155e37ff7d378578751d1e8793c102d73067902a03f9eab61f6e6b6febe00d29e8d6ea023b6647b6d1e3f8c92790883ff342015
@@ -30,6 +30,16 @@ module Admin
30
30
  end
31
31
  end
32
32
  end.join.html_safe
33
+ end.search do |collection, term, column, sql_column|
34
+ user_klass = Effective::CpdAudit.first.user&.class
35
+
36
+ if user_klass.present?
37
+ users = Effective::Resource.new(user_klass).search_any(term)
38
+ cpd_audit_reviews = Effective::CpdAuditReview.where(user_id: users)
39
+ collection.where(id: cpd_audit_reviews.select('cpd_audit_id AS id'))
40
+ else
41
+ collection.where(id: nil)
42
+ end
33
43
  end
34
44
 
35
45
  col :notification_date, label: 'Date of Notification'
@@ -39,7 +49,7 @@ module Admin
39
49
  col :status
40
50
  col :determination
41
51
 
42
- col(:auditee_cpd_statements, label: 'Auditee Statements') do |cpd_audit|
52
+ col(:auditee_cpd_statements, label: 'Auditee Statements', visible: false) do |cpd_audit|
43
53
  cpd_audit.user.cpd_statements.map do |cpd_statement|
44
54
  content_tag(:div, class: 'col-resource_item') do
45
55
  link_to(cpd_statement.to_s, effective_cpd.admin_cpd_statement_path(cpd_statement))
@@ -38,7 +38,7 @@ module Effective
38
38
  validates :original, presence: true, if: -> { carry_over.to_i > 0 }
39
39
  validates :description, presence: true
40
40
 
41
- validate(if: -> { cpd_statement.present? }) do
41
+ validate(if: -> { new_record? && cpd_statement.present? }) do
42
42
  self.errors.add(:base, "statement has already been completed") if cpd_statement.completed?
43
43
  self.errors.add(:base, "cycle is unavailable") unless cpd_statement.cpd_cycle.available?
44
44
  end
@@ -17,4 +17,4 @@
17
17
  - if cpd_audit_level_section.bottom_content.present?
18
18
  .mb-2= cpd_audit_level_section.bottom_content
19
19
 
20
- = f.submit 'Start', center: true
20
+ = f.submit 'Save and Continue', center: true
@@ -1,3 +1,3 @@
1
1
  module EffectiveCpd
2
- VERSION = '0.1.12'
2
+ VERSION = '0.1.16'
3
3
  end
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: 0.1.12
4
+ version: 0.1.16
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: 2021-06-16 00:00:00.000000000 Z
11
+ date: 2021-10-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails