effective_cpd 1.6.2 → 1.6.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_user.rb +11 -0
- data/config/locales/effective_cpd.en.yml +10 -3
- data/lib/effective_cpd/version.rb +1 -1
- data/lib/effective_cpd.rb +12 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 922313bd91077ecfcc7021a812ef4b90bc3872b79827b4347a2d6e75a0edf483
|
4
|
+
data.tar.gz: 309a23f429945e56441cbe20f60f279c31bd62326aabe0d2fa4bf8762c1dd26e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fe546f711f3899bd5bfd5354d248fcfa5e1a8e82fcf5271c365b24d99902c9bf2c5618032d781d12852263c231d615ecfefb468128f829bc2b991181a0ee93c0
|
7
|
+
data.tar.gz: 3bf62bf5078dfb8a6eb6bc448f44f2542af644eb9ddc145b2a35a612047ce9631d2a8442df40606ebd26c1d9b7cf8cf197ad8668f03cc536ebe74a323a9d3a13
|
@@ -113,6 +113,17 @@ module EffectiveCpdUser
|
|
113
113
|
end.sort_by(&:cpd_cycle_id).reverse
|
114
114
|
end
|
115
115
|
|
116
|
+
# These two are checked by effective memberships for the CPD step
|
117
|
+
def cpd_current_statement_completed?(date: nil)
|
118
|
+
cpd_cycle = EffectiveCpd.current_cpd_cycle(date: date)
|
119
|
+
cpd_cycle.present? && cpd_statement(cpd_cycle: cpd_cycle).try(:completed?)
|
120
|
+
end
|
121
|
+
|
122
|
+
def cpd_previous_statement_completed?(date: nil)
|
123
|
+
cpd_cycle = EffectiveCpd.previous_cpd_cycle(date: date)
|
124
|
+
cpd_cycle.present? && cpd_statement(cpd_cycle: cpd_cycle).try(:completed?)
|
125
|
+
end
|
126
|
+
|
116
127
|
private
|
117
128
|
|
118
129
|
def reject_cpd_target_attributes(atts)
|
@@ -8,21 +8,21 @@ en:
|
|
8
8
|
|
9
9
|
activerecord:
|
10
10
|
models:
|
11
|
-
#
|
11
|
+
# Application namespace
|
12
12
|
cpd_audit: 'CPD Audit'
|
13
13
|
cpd_audit_level: 'CPD Audit Level'
|
14
14
|
cpd_audit_review: 'CPD Audit Review'
|
15
15
|
cpd_bulk_audit: 'Bulk Create CPD Audit Review'
|
16
16
|
cpd_statement: 'CPD Statement'
|
17
17
|
|
18
|
-
#
|
18
|
+
# Effective namespace
|
19
19
|
effective/cpd_cycle: 'CPD Period'
|
20
20
|
effective/cpd_statement_activity: 'CPD Statement Activity'
|
21
21
|
effective/cpd_category: 'CPD Category'
|
22
22
|
effective/cpd_target: 'CPD Target'
|
23
23
|
|
24
24
|
attributes:
|
25
|
-
#
|
25
|
+
# Application namespace
|
26
26
|
cpd_audit:
|
27
27
|
user: 'Auditee'
|
28
28
|
cpd_audit_comments: 'Reviewer Notes'
|
@@ -30,3 +30,10 @@ en:
|
|
30
30
|
cpd_audit_review:
|
31
31
|
user: 'Reviewer'
|
32
32
|
comments: 'Reviewer Notes'
|
33
|
+
|
34
|
+
cpd_statement:
|
35
|
+
cpd_cycle: 'CPD Period'
|
36
|
+
|
37
|
+
# Effective namespace
|
38
|
+
effective/cpd_statement_activity:
|
39
|
+
cpd_cycle: 'CPD Period'
|
data/lib/effective_cpd.rb
CHANGED
@@ -53,4 +53,16 @@ module EffectiveCpd
|
|
53
53
|
defined?(EffectiveMessaging) && !!use_effective_messaging
|
54
54
|
end
|
55
55
|
|
56
|
+
def self.current_cpd_cycle(date: nil)
|
57
|
+
date ||= Time.zone.now
|
58
|
+
cpd_cycles = Effective::CpdCycle.all.reorder(start_at: :asc).all.where('start_at <= ?', date)
|
59
|
+
cpd_cycles.to_a.last
|
60
|
+
end
|
61
|
+
|
62
|
+
def self.previous_cpd_cycle(date: nil)
|
63
|
+
date ||= Time.zone.now
|
64
|
+
cpd_cycles = Effective::CpdCycle.all.reorder(start_at: :asc).all.where('start_at <= ?', date)
|
65
|
+
cpd_cycles.to_a.last(2).first
|
66
|
+
end
|
67
|
+
|
56
68
|
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: 1.6.
|
4
|
+
version: 1.6.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-04-
|
11
|
+
date: 2023-04-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|