state_machines-audit_trail 2.1.0 → 3.0.0

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: 661c7c543a31ede30e81d2a4eb7429899706a3462dccf8ae9ebb84f9d928aa5a
4
- data.tar.gz: f1cad3fd778fbe4ad2009eede151ed65b26d00e2c4289e783052530f0ddbb1fd
3
+ metadata.gz: 9763326e11e39a7a8876a9fa2235cb93a5bb9d8abc8dbdce4cee04fa7d47437e
4
+ data.tar.gz: 78a8f897991391f2e590858315c9970aa2e3d8de1c5a5a6af3772911611cf2a3
5
5
  SHA512:
6
- metadata.gz: 25af57e9c8fe164681b99a81a41c1d93c81088e38af6b3f8a1761160ee46e9c3c3da75739511382541c084765e194ba20f5ff4132d47700eafbdf3a8909561e5
7
- data.tar.gz: d3db2da4ffbed9fdf5cc870602245e2c80039f2a193b46ceb30d3460518c0e4fa7fe23b506a44ada42d784eb50fb5a9caab73984140242c6900a25b9b791756a
6
+ metadata.gz: 95b780a557c38b332fe4050773474cca8534b4d37b4e89bba7066a7296d3a224f269617eba253a96412d34617dc99b9d9a2f0089b38a95638ee61b8e74d6dfd7
7
+ data.tar.gz: 692efbe5208fb4437d4c18c290b2c7082551b967f799cc7384f1771280d576bd4ac1853e86508cc845484660cd0dc482b7a2b3c2fbd2a87bb1a6a337b19e8c7d
data/README.md CHANGED
@@ -1,4 +1,4 @@
1
- [![Code Climate](https://codeclimate.com/github/state-machines/state_machines-audit_trail.svg)](https://codeclimate.com/github/state-machines/state_machines-audit_trail)
1
+ ![Build Status](https://github.com/state-machines/state_machines-audit_trail/actions/workflows/ruby.yml/badge.svg)
2
2
 
3
3
  # state_machines-audit_trail
4
4
  Log transitions on a [state_machines gem](https://github.com/state-machines/state_machines) to support auditing and business process analytics.
@@ -11,7 +11,7 @@ for any state machine. Having an audit trail gives you a complete history of the
11
11
  to investigate incidents or perform analytics, like: _"How long does it take on average to go from state a to state b?"_,
12
12
  or _"What percentage of cases goes from state a to b via state c?"_
13
13
 
14
- For more information read [Why developers should be force-fed state machines](https://engineering.shopify.com/blogs/engineering/17488160-why-developers-should-be-force-fed-state-machines).
14
+ For more information read [Why developers should be force-fed state machines](https://engineering.shopify.com/17488160-why-developers-should-be-force-fed-state-machines).
15
15
 
16
16
  ## ORM support
17
17
 
@@ -1,5 +1,5 @@
1
1
  module StateMachines
2
2
  module AuditTrail
3
- VERSION = '2.1.0'
3
+ VERSION = '3.0.0'
4
4
  end
5
5
  end
@@ -3,39 +3,43 @@ require 'active_record'
3
3
  ### Setup test database
4
4
  ActiveRecord::Base.establish_connection(:adapter => 'sqlite3', :database => ':memory:')
5
5
 
6
- class ARModelStateTransition < ActiveRecord::Base
7
- belongs_to :ar_model
6
+ class ApplicationRecord < ActiveRecord::Base
7
+ self.abstract_class = true
8
8
  end
9
9
 
10
- class ARModelWithNamespaceFooStateTransition < ActiveRecord::Base
11
- belongs_to :ar_model_with_namespace
10
+ class ARModelStateTransition < ApplicationRecord
11
+ belongs_to :ar_model, class_name: 'ARModel'
12
12
  end
13
13
 
14
- class ARModelNoInitialStateTransition < ActiveRecord::Base
15
- belongs_to :ar_model_no_initial
14
+ class ARModelWithNamespaceFooStateTransition < ApplicationRecord
15
+ belongs_to :ar_model_with_namespace, class_name: 'ARModelWithNamespace'
16
16
  end
17
17
 
18
- class ARModelWithContextStateTransition < ActiveRecord::Base
19
- belongs_to :ar_model_with_context
18
+ class ARModelNoInitialStateTransition < ApplicationRecord
19
+ belongs_to :ar_model_no_initial, class_name: 'ARModelNoInitial'
20
20
  end
21
21
 
22
- class ARModelWithMultipleContextStateTransition < ActiveRecord::Base
23
- belongs_to :ar_model_with_multiple_context
22
+ class ARModelWithContextStateTransition < ApplicationRecord
23
+ belongs_to :ar_model_with_context, class_name: 'ARModelWithContext'
24
24
  end
25
25
 
26
- class ARModelWithMultipleStateMachinesFirstTransition < ActiveRecord::Base
27
- belongs_to :ar_model_with_multiple_state_machines
26
+ class ARModelWithMultipleContextStateTransition < ApplicationRecord
27
+ belongs_to :ar_model_with_multiple_context, class_name: 'ARModelWithMultipleContext'
28
28
  end
29
29
 
30
- class ARModelWithMultipleStateMachinesSecondTransition < ActiveRecord::Base
31
- belongs_to :ar_model_with_multiple_state_machines
30
+ class ARModelWithMultipleStateMachinesFirstTransition < ApplicationRecord
31
+ belongs_to :ar_model_with_multiple_state_machines, class_name: 'ARModelWithMultipleStateMachines'
32
32
  end
33
33
 
34
- class ARModelWithMultipleStateMachinesThirdTransition < ActiveRecord::Base
35
- belongs_to :ar_model_with_multiple_state_machines
34
+ class ARModelWithMultipleStateMachinesSecondTransition < ApplicationRecord
35
+ belongs_to :ar_model_with_multiple_state_machines, class_name: 'ARModelWithMultipleStateMachines'
36
36
  end
37
37
 
38
- class ARModel < ActiveRecord::Base
38
+ class ARModelWithMultipleStateMachinesThirdTransition < ApplicationRecord
39
+ belongs_to :ar_model_with_multiple_state_machines, class_name: 'ARModelWithMultipleStateMachines'
40
+ end
41
+
42
+ class ARModel < ApplicationRecord
39
43
 
40
44
  state_machine :state, initial: :waiting do
41
45
  audit_trail
@@ -50,7 +54,7 @@ class ARModel < ActiveRecord::Base
50
54
  end
51
55
  end
52
56
 
53
- class ARModelNoInitial < ActiveRecord::Base
57
+ class ARModelNoInitial < ApplicationRecord
54
58
 
55
59
  state_machine :state, initial: :waiting do
56
60
  audit_trail initial: false
@@ -65,7 +69,7 @@ class ARModelNoInitial < ActiveRecord::Base
65
69
  end
66
70
  end
67
71
 
68
- class ARModelWithNamespace < ActiveRecord::Base
72
+ class ARModelWithNamespace < ApplicationRecord
69
73
 
70
74
  state_machine :foo_state, initial: :waiting, namespace: :foo do
71
75
  audit_trail
@@ -81,7 +85,7 @@ class ARModelWithNamespace < ActiveRecord::Base
81
85
  end
82
86
 
83
87
  #
84
- class ARModelWithContext < ActiveRecord::Base
88
+ class ARModelWithContext < ApplicationRecord
85
89
  state_machine :state, initial: :waiting do
86
90
  audit_trail context: :context
87
91
 
@@ -99,7 +103,7 @@ class ARModelWithContext < ActiveRecord::Base
99
103
  end
100
104
  end
101
105
 
102
- class ARModelWithMultipleContext < ActiveRecord::Base
106
+ class ARModelWithMultipleContext < ApplicationRecord
103
107
  state_machine :state, initial: :waiting do
104
108
  audit_trail context: [:context, :second_context, :context_with_args]
105
109
 
@@ -140,7 +144,7 @@ class ARModelDescendantWithOwnStateMachines < ARModel
140
144
  end
141
145
  end
142
146
 
143
- class ARModelWithMultipleStateMachines < ActiveRecord::Base
147
+ class ARModelWithMultipleStateMachines < ApplicationRecord
144
148
 
145
149
  state_machine :first, :initial => :beginning do
146
150
  audit_trail
@@ -171,11 +175,11 @@ class ARModelWithMultipleStateMachines < ActiveRecord::Base
171
175
  end
172
176
  end
173
177
 
174
- class ARResourceStateTransition < ActiveRecord::Base
178
+ class ARResourceStateTransition < ApplicationRecord
175
179
  belongs_to :resource, polymorphic: true
176
180
  end
177
181
 
178
- class ARFirstModelWithPolymorphicStateTransition < ActiveRecord::Base
182
+ class ARFirstModelWithPolymorphicStateTransition < ApplicationRecord
179
183
  state_machine :state, :initial => :pending do
180
184
  audit_trail class: ARResourceStateTransition, as: :ar_resource
181
185
 
@@ -189,7 +193,7 @@ class ARFirstModelWithPolymorphicStateTransition < ActiveRecord::Base
189
193
  end
190
194
  end
191
195
 
192
- class ARSecondModelWithPolymorphicStateTransition < ActiveRecord::Base
196
+ class ARSecondModelWithPolymorphicStateTransition < ApplicationRecord
193
197
  state_machine :state, :initial => :pending do
194
198
  audit_trail class: ARResourceStateTransition, as: :ar_resource
195
199
 
@@ -204,11 +208,11 @@ class ARSecondModelWithPolymorphicStateTransition < ActiveRecord::Base
204
208
  end
205
209
 
206
210
  module SomeModule
207
- class ARModelStateTransition < ActiveRecord::Base
208
- belongs_to :ar_model
211
+ class ARModelStateTransition < ApplicationRecord
212
+ belongs_to :ar_model, class_name: 'SomeModule::ARModel'
209
213
  end
210
214
 
211
- class ARModel < ActiveRecord::Base
215
+ class ARModel < ApplicationRecord
212
216
 
213
217
  state_machine :state, initial: :waiting do
214
218
  audit_trail
metadata CHANGED
@@ -1,16 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: state_machines-audit_trail
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.0
4
+ version: 3.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kevin Ross
8
8
  - Willem van Bergen
9
9
  - Jesse Storimer
10
- autorequire:
11
10
  bindir: bin
12
11
  cert_chain: []
13
- date: 2024-01-22 00:00:00.000000000 Z
12
+ date: 1980-01-02 00:00:00.000000000 Z
14
13
  dependencies:
15
14
  - !ruby/object:Gem::Dependency
16
15
  name: state_machines
@@ -18,14 +17,14 @@ dependencies:
18
17
  requirements:
19
18
  - - ">="
20
19
  - !ruby/object:Gem::Version
21
- version: '0'
20
+ version: 0.10.0
22
21
  type: :runtime
23
22
  prerelease: false
24
23
  version_requirements: !ruby/object:Gem::Requirement
25
24
  requirements:
26
25
  - - ">="
27
26
  - !ruby/object:Gem::Version
28
- version: '0'
27
+ version: 0.10.0
29
28
  - !ruby/object:Gem::Dependency
30
29
  name: state_machines-activerecord
31
30
  requirement: !ruby/object:Gem::Requirement
@@ -96,6 +95,34 @@ dependencies:
96
95
  - - ">="
97
96
  - !ruby/object:Gem::Version
98
97
  version: '0'
98
+ - !ruby/object:Gem::Dependency
99
+ name: sqlite3
100
+ requirement: !ruby/object:Gem::Requirement
101
+ requirements:
102
+ - - "~>"
103
+ - !ruby/object:Gem::Version
104
+ version: '1.7'
105
+ type: :development
106
+ prerelease: false
107
+ version_requirements: !ruby/object:Gem::Requirement
108
+ requirements:
109
+ - - "~>"
110
+ - !ruby/object:Gem::Version
111
+ version: '1.7'
112
+ - !ruby/object:Gem::Dependency
113
+ name: activerecord
114
+ requirement: !ruby/object:Gem::Requirement
115
+ requirements:
116
+ - - ">="
117
+ - !ruby/object:Gem::Version
118
+ version: '7.1'
119
+ type: :development
120
+ prerelease: false
121
+ version_requirements: !ruby/object:Gem::Requirement
122
+ requirements:
123
+ - - ">="
124
+ - !ruby/object:Gem::Version
125
+ version: '7.1'
99
126
  description: Log transitions on a state_machines to support auditing and business
100
127
  process analytics.
101
128
  email:
@@ -130,7 +157,6 @@ homepage: https://github.com/state-machines/state_machines-audit_trail
130
157
  licenses:
131
158
  - MIT
132
159
  metadata: {}
133
- post_install_message:
134
160
  rdoc_options: []
135
161
  require_paths:
136
162
  - lib
@@ -145,8 +171,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
145
171
  - !ruby/object:Gem::Version
146
172
  version: '0'
147
173
  requirements: []
148
- rubygems_version: 3.4.10
149
- signing_key:
174
+ rubygems_version: 3.6.7
150
175
  specification_version: 4
151
176
  summary: Log transitions on a state_machines to support auditing and business process
152
177
  analytics.