effective_cpd 0.6.5 → 0.6.6

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: 4773c3b6961452cc64a5378b56d7227bab9c08df6bfc812d82f433988d8dfb03
4
- data.tar.gz: e92d9b394e070adeb054cf19ecf72ab6dd36a16dc144021fd7aa249bc33bbfd9
3
+ metadata.gz: f119fa3686ef62e2b4b785b32f9da5775bb1d809564189cd294a1b018dc3f749
4
+ data.tar.gz: 34601ca091deac96e428bebb3d013ea504ec0047413af9baa047fc3199a52201
5
5
  SHA512:
6
- metadata.gz: 3fa597aabce1172fd1070d7d907eea1eb0452d44d3e920ca0b4d553f96b5c3ef8901cdf9714c7ac0b44c61a615f45665ae00a78e83acd7da5171759730ce3a89
7
- data.tar.gz: 26b1acedec51bd60c81a485de86cc35d084d8bb16e8e7648e3c84a0b48743b603fedba909c9a4c3b48554fc59ed12a50a70c8dbe1414a9be3ffe452b350115e7
6
+ metadata.gz: eb27171d3f177bc81cb3831d13902f61402049a8e07889c9e476fa38153007ed734baaa990d7376bd6c318d41de6d39c12588156898165453dc9775477e3dc88
7
+ data.tar.gz: e96c06221841c0f35f81459ce7664dd002dfd53d02f30feb4a25b9ebe874f70208736eb2263ee6757cf5a89ca9990cacc8dd4184a485227407e6bad8a91b4521
@@ -19,6 +19,7 @@ module EffectiveCpdStatement
19
19
 
20
20
  included do
21
21
  acts_as_tokened
22
+ acts_as_reportable if respond_to?(:acts_as_reportable)
22
23
 
23
24
  acts_as_wizard(
24
25
  start: 'Start',
@@ -68,6 +69,11 @@ module EffectiveCpdStatement
68
69
  scope :draft, -> { where(submitted_at: nil) }
69
70
  scope :completed, -> { where.not(submitted_at: nil) }
70
71
 
72
+ # effective_reports
73
+ def reportable_scopes
74
+ { draft: nil, completed: nil }
75
+ end
76
+
71
77
  before_validation(if: -> { new_record? }) do
72
78
  self.user ||= current_user
73
79
  self.score ||= 0
@@ -23,6 +23,7 @@ module Effective
23
23
 
24
24
  acts_as_email_form
25
25
  acts_as_tokened
26
+ acts_as_reportable if respond_to?(:acts_as_reportable)
26
27
 
27
28
  COMPLETED_STATES = [:exemption_granted, :closed]
28
29
 
@@ -120,6 +121,11 @@ module Effective
120
121
  scope :waiting_on_auditee, -> { where(status: WAITING_ON_AUDITEE_STATES) }
121
122
  scope :waiting_on_reviewers, -> { where(status: WAITING_ON_REVIEWERS_STATES) }
122
123
 
124
+ # effective_reports
125
+ def reportable_scopes
126
+ { draft: nil, available: nil, completed: nil, waiting_on_admin: nil, waiting_on_auditee: nil, waiting_on_reviewers: nil }
127
+ end
128
+
123
129
  before_validation(if: -> { new_record? }) do
124
130
  self.notification_date ||= Time.zone.now
125
131
  self.due_date ||= deadline_to_submit()
@@ -16,6 +16,7 @@ module Effective
16
16
 
17
17
  acts_as_email_form
18
18
  acts_as_tokened
19
+ acts_as_reportable if respond_to?(:acts_as_reportable)
19
20
 
20
21
  acts_as_wizard(
21
22
  start: 'Start',
@@ -72,6 +73,11 @@ module Effective
72
73
  scope :available, -> { where(submitted_at: nil) }
73
74
  scope :completed, -> { where.not(submitted_at: nil) }
74
75
 
76
+ # effective_reports
77
+ def reportable_scopes
78
+ { available: nil, completed: nil }
79
+ end
80
+
75
81
  before_validation(if: -> { new_record? }) do
76
82
  self.cpd_audit_level ||= cpd_audit&.cpd_audit_level
77
83
  self.due_date ||= deadline_to_review()
@@ -16,9 +16,8 @@ module Effective
16
16
 
17
17
  has_many_attached :files
18
18
 
19
- if respond_to?(:log_changes)
20
- log_changes(to: :cpd_statement)
21
- end
19
+ acts_as_reportable if respond_to?(:acts_as_reportable)
20
+ log_changes(to: :cpd_statement) if respond_to?(:log_changes)
22
21
 
23
22
  effective_resource do
24
23
  amount :decimal
@@ -44,6 +43,11 @@ module Effective
44
43
  scope :draft, -> { where(cpd_statement_id: EffectiveCpd.CpdStatement.draft) }
45
44
  scope :completed, -> { where(cpd_statement_id: EffectiveCpd.CpdStatement.completed) }
46
45
 
46
+ # effective_reports
47
+ def reportable_scopes
48
+ { draft: nil, completed: nil }
49
+ end
50
+
47
51
  validates :original, presence: true, if: -> { (carry_over || 0) > 0 }
48
52
  validates :description, presence: true
49
53
 
@@ -1,3 +1,3 @@
1
1
  module EffectiveCpd
2
- VERSION = '0.6.5'
2
+ VERSION = '0.6.6'
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.6.5
4
+ version: 0.6.6
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: 2022-12-06 00:00:00.000000000 Z
11
+ date: 2023-01-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails