state_machines-audit_trail 2.0.2 → 2.1.0

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: fa9c1aad624d9dad005c50ab44eb5522908b1790490f6e8b1eacc1b05261a7e3
4
- data.tar.gz: 9bcb723941ab88d56534181ad6be0c147de7262ee408c2a5607a77bd146b94e2
3
+ metadata.gz: 661c7c543a31ede30e81d2a4eb7429899706a3462dccf8ae9ebb84f9d928aa5a
4
+ data.tar.gz: f1cad3fd778fbe4ad2009eede151ed65b26d00e2c4289e783052530f0ddbb1fd
5
5
  SHA512:
6
- metadata.gz: ffaacbb29036d844d7a25d72da512906bee8d7a646e63b42b68f3f99bfcd7ff572e33177b84cf85ef079cb284dc2667611ce22b40835d524f065fdfb76f7926f
7
- data.tar.gz: 15cf000aea32b80c3f0cf675fe9cad34574ce127d4328c3faea9f70b62e7d35550b67ef62ed9209000bf46c84e949ccec27821ba2d90861cfb075c43ae616a76
6
+ metadata.gz: 25af57e9c8fe164681b99a81a41c1d93c81088e38af6b3f8a1761160ee46e9c3c3da75739511382541c084765e194ba20f5ff4132d47700eafbdf3a8909561e5
7
+ data.tar.gz: d3db2da4ffbed9fdf5cc870602245e2c80039f2a193b46ceb30d3460518c0e4fa7fe23b506a44ada42d784eb50fb5a9caab73984140242c6900a25b9b791756a
data/README.md CHANGED
@@ -1,4 +1,3 @@
1
- [![Build Status](https://travis-ci.org/state-machines/state_machines-audit_trail.svg?branch=master)](https://travis-ci.org/state-machines/state_machines-audit_trail)
2
1
  [![Code Climate](https://codeclimate.com/github/state-machines/state_machines-audit_trail.svg)](https://codeclimate.com/github/state-machines/state_machines-audit_trail)
3
2
 
4
3
  # state_machines-audit_trail
data/Rakefile CHANGED
@@ -6,10 +6,4 @@ RSpec::Core::RakeTask.new(:spec) do |task|
6
6
  task.rspec_opts = ['--color']
7
7
  end
8
8
 
9
- if ENV['APPRAISAL_INITIALIZED'] || ENV['TRAVIS']
10
- task :default => :spec
11
- else
12
- require 'appraisal'
13
- Appraisal::Task.new
14
- task :default => :appraisal
15
- end
9
+ task :default => :spec
@@ -1,4 +1,3 @@
1
- require 'ostruct'
2
1
  #
3
2
  # This module inserts hooks into the state machine.
4
3
  # The transition_class is the class (optionally specified with the :class option) for the model which
@@ -7,6 +6,30 @@ require 'ostruct'
7
6
  # Multiple `SubscriptionStateTransition`s compose the 'audit_trail'.
8
7
  #
9
8
  module StateMachines::AuditTrail::TransitionAuditing
9
+ class InitialTransition
10
+ attr_reader :namespace, :to
11
+
12
+ def initialize(namespace:, to:)
13
+ @namespace = namespace
14
+ @to = to
15
+ end
16
+
17
+ def from
18
+ nil
19
+ end
20
+
21
+ def event
22
+ nil
23
+ end
24
+
25
+ def machine
26
+ nil
27
+ end
28
+
29
+ def args
30
+ nil
31
+ end
32
+ end
10
33
 
11
34
  # Hook for audit_trail inside a a state_machine declaration.
12
35
  #
@@ -35,7 +58,7 @@ module StateMachines::AuditTrail::TransitionAuditing
35
58
  if state_machine.backend.new_record? object
36
59
  current_state = object.send(state_machine.attribute)
37
60
  if !current_state.nil?
38
- state_machine.backend.log(object, OpenStruct.new(namespace: state_machine.namespace, to: current_state))
61
+ state_machine.backend.log(object, InitialTransition.new(namespace: state_machine.namespace, to: current_state))
39
62
  end
40
63
  end
41
64
  end
@@ -1,5 +1,5 @@
1
1
  module StateMachines
2
2
  module AuditTrail
3
- VERSION = '2.0.2'
3
+ VERSION = '2.1.0'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: state_machines-audit_trail
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.2
4
+ version: 2.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kevin Ross
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2020-06-09 00:00:00.000000000 Z
13
+ date: 2024-01-22 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: state_machines
@@ -40,20 +40,6 @@ dependencies:
40
40
  - - ">="
41
41
  - !ruby/object:Gem::Version
42
42
  version: '0'
43
- - !ruby/object:Gem::Dependency
44
- name: state_machines-mongoid
45
- requirement: !ruby/object:Gem::Requirement
46
- requirements:
47
- - - ">="
48
- - !ruby/object:Gem::Version
49
- version: '0'
50
- type: :development
51
- prerelease: false
52
- version_requirements: !ruby/object:Gem::Requirement
53
- requirements:
54
- - - ">="
55
- - !ruby/object:Gem::Version
56
- version: '0'
57
43
  - !ruby/object:Gem::Dependency
58
44
  name: rake
59
45
  requirement: !ruby/object:Gem::Requirement
@@ -83,49 +69,7 @@ dependencies:
83
69
  - !ruby/object:Gem::Version
84
70
  version: 3.0.0
85
71
  - !ruby/object:Gem::Dependency
86
- name: activerecord
87
- requirement: !ruby/object:Gem::Requirement
88
- requirements:
89
- - - ">="
90
- - !ruby/object:Gem::Version
91
- version: 5.0.0
92
- type: :development
93
- prerelease: false
94
- version_requirements: !ruby/object:Gem::Requirement
95
- requirements:
96
- - - ">="
97
- - !ruby/object:Gem::Version
98
- version: 5.0.0
99
- - !ruby/object:Gem::Dependency
100
- name: sqlite3
101
- requirement: !ruby/object:Gem::Requirement
102
- requirements:
103
- - - ">="
104
- - !ruby/object:Gem::Version
105
- version: '0'
106
- type: :development
107
- prerelease: false
108
- version_requirements: !ruby/object:Gem::Requirement
109
- requirements:
110
- - - ">="
111
- - !ruby/object:Gem::Version
112
- version: '0'
113
- - !ruby/object:Gem::Dependency
114
- name: mongoid
115
- requirement: !ruby/object:Gem::Requirement
116
- requirements:
117
- - - ">="
118
- - !ruby/object:Gem::Version
119
- version: 6.0.0.beta
120
- type: :development
121
- prerelease: false
122
- version_requirements: !ruby/object:Gem::Requirement
123
- requirements:
124
- - - ">="
125
- - !ruby/object:Gem::Version
126
- version: 6.0.0.beta
127
- - !ruby/object:Gem::Dependency
128
- name: bson
72
+ name: generator_spec
129
73
  requirement: !ruby/object:Gem::Requirement
130
74
  requirements:
131
75
  - - ">="
@@ -139,7 +83,7 @@ dependencies:
139
83
  - !ruby/object:Gem::Version
140
84
  version: '0'
141
85
  - !ruby/object:Gem::Dependency
142
- name: generator_spec
86
+ name: appraisal
143
87
  requirement: !ruby/object:Gem::Requirement
144
88
  requirements:
145
89
  - - ">="
@@ -152,34 +96,6 @@ dependencies:
152
96
  - - ">="
153
97
  - !ruby/object:Gem::Version
154
98
  version: '0'
155
- - !ruby/object:Gem::Dependency
156
- name: rails
157
- requirement: !ruby/object:Gem::Requirement
158
- requirements:
159
- - - ">="
160
- - !ruby/object:Gem::Version
161
- version: 5.0.0
162
- type: :development
163
- prerelease: false
164
- version_requirements: !ruby/object:Gem::Requirement
165
- requirements:
166
- - - ">="
167
- - !ruby/object:Gem::Version
168
- version: 5.0.0
169
- - !ruby/object:Gem::Dependency
170
- name: appraisal
171
- requirement: !ruby/object:Gem::Requirement
172
- requirements:
173
- - - "~>"
174
- - !ruby/object:Gem::Version
175
- version: 2.2.0
176
- type: :development
177
- prerelease: false
178
- version_requirements: !ruby/object:Gem::Requirement
179
- requirements:
180
- - - "~>"
181
- - !ruby/object:Gem::Version
182
- version: 2.2.0
183
99
  description: Log transitions on a state_machines to support auditing and business
184
100
  process analytics.
185
101
  email:
@@ -190,21 +106,9 @@ executables: []
190
106
  extensions: []
191
107
  extra_rdoc_files: []
192
108
  files:
193
- - ".gitignore"
194
- - ".rspec"
195
- - ".ruby-gemset"
196
- - ".ruby-version"
197
- - ".travis.yml"
198
- - Appraisals
199
- - Gemfile
200
109
  - LICENSE
201
110
  - README.md
202
111
  - Rakefile
203
- - gemfiles/rails_5.0.gemfile
204
- - gemfiles/rails_5.1.gemfile
205
- - gemfiles/rails_5.2.gemfile
206
- - gemfiles/rails_6.0.gemfile
207
- - gemfiles/rails_edge.gemfile
208
112
  - lib/state_machines-audit_trail.rb
209
113
  - lib/state_machines/audit_trail.rb
210
114
  - lib/state_machines/audit_trail/backend.rb
@@ -222,7 +126,6 @@ files:
222
126
  - spec/lib/state_machines/audit_trail_generator_spec.rb
223
127
  - spec/lib/state_machines/audit_trail_spec.rb
224
128
  - spec/spec_helper.rb
225
- - state_machines-audit_trail.gemspec
226
129
  homepage: https://github.com/state-machines/state_machines-audit_trail
227
130
  licenses:
228
131
  - MIT
@@ -242,7 +145,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
242
145
  - !ruby/object:Gem::Version
243
146
  version: '0'
244
147
  requirements: []
245
- rubygems_version: 3.0.3
148
+ rubygems_version: 3.4.10
246
149
  signing_key:
247
150
  specification_version: 4
248
151
  summary: Log transitions on a state_machines to support auditing and business process
data/.gitignore DELETED
@@ -1,10 +0,0 @@
1
- *.gem
2
- .bundle
3
- Gemfile.lock
4
- *.gemfile.lock
5
- pkg/*
6
- .DS_Store
7
- *.rbc
8
- /doc
9
- .yardoc
10
- .idea
data/.rspec DELETED
@@ -1,2 +0,0 @@
1
- --color
2
- --require spec_helper
data/.ruby-gemset DELETED
@@ -1 +0,0 @@
1
- state_machines-audit_trail
data/.ruby-version DELETED
@@ -1 +0,0 @@
1
- 2.3.1
data/.travis.yml DELETED
@@ -1,43 +0,0 @@
1
- language: ruby
2
- cache: bundler
3
-
4
- script: "bundle exec rake"
5
-
6
- services: mongodb
7
- rvm:
8
- - 2.2
9
- - 2.3
10
- - 2.4
11
- - 2.5
12
- - 2.6
13
- - 2.7
14
- - ruby-head
15
- - jruby-head
16
- - jruby
17
- - rbx-2
18
- gemfile:
19
- - gemfiles/rails_5.0.gemfile
20
- - gemfiles/rails_5.1.gemfile
21
- - gemfiles/rails_5.2.gemfile
22
- - gemfiles/rails_6.0.gemfile
23
- - gemfiles/rails_edge.gemfile
24
- matrix:
25
- exclude:
26
- - rvm: 2.2
27
- gemfile: gemfiles/rails_6.0.gemfile
28
- - rvm: 2.3
29
- gemfile: gemfiles/rails_6.0.gemfile
30
- - rvm: 2.4
31
- gemfile: gemfiles/rails_6.0.gemfile
32
- - rvm: 2.2
33
- gemfile: gemfiles/rails_edge.gemfile
34
- - rvm: 2.3
35
- gemfile: gemfiles/rails_edge.gemfile
36
- - rvm: 2.4
37
- gemfile: gemfiles/rails_edge.gemfile
38
- allow_failures:
39
- - rvm: rbx-2
40
- - rvm: ruby-head
41
- - rvm: jruby-head
42
- - gemfile: gemfiles/rails_edge.gemfile
43
-
data/Appraisals DELETED
@@ -1,16 +0,0 @@
1
- appraise 'rails_5.0' do
2
- gem 'activerecord', '~> 5.0'
3
- gem 'activemodel', '~> 5.0'
4
- end
5
-
6
- appraise 'rails_5.1' do
7
- gem 'activerecord', '~> 5.1'
8
- gem 'activemodel', '~> 5.1'
9
- end
10
-
11
- appraise 'rails_edge' do
12
- gem 'rails', github: 'rails/rails', branch: 'master'
13
- gem 'activerecord', github: 'rails/rails', branch: 'master'
14
- gem 'activemodel', github: 'rails/rails', branch: 'master'
15
- gem 'arel', github: 'rails/arel', branch: 'master'
16
- end
data/Gemfile DELETED
@@ -1,2 +0,0 @@
1
- source 'https://rubygems.org'
2
- gemspec
@@ -1,9 +0,0 @@
1
- # This file was generated by Appraisal
2
-
3
- source "https://rubygems.org"
4
-
5
- gem "activerecord", "~> 5.0.0"
6
- gem "activemodel", "~> 5.0.0"
7
- gem "sqlite3", "~> 1.3.6"
8
-
9
- gemspec path: "../"
@@ -1,8 +0,0 @@
1
- # This file was generated by Appraisal
2
-
3
- source "https://rubygems.org"
4
-
5
- gem "activerecord", "~> 5.1.0"
6
- gem "activemodel", "~> 5.1.0"
7
-
8
- gemspec path: "../"
@@ -1,8 +0,0 @@
1
- # This file was generated by Appraisal
2
-
3
- source "https://rubygems.org"
4
-
5
- gem "activerecord", "~> 5.2.0"
6
- gem "activemodel", "~> 5.2.0"
7
-
8
- gemspec path: "../"
@@ -1,8 +0,0 @@
1
- # This file was generated by Appraisal
2
-
3
- source "https://rubygems.org"
4
-
5
- gem "activerecord", "~> 6.0.0"
6
- gem "activemodel", "~> 6.0.0"
7
-
8
- gemspec path: "../"
@@ -1,10 +0,0 @@
1
- # This file was generated by Appraisal
2
-
3
- source "https://rubygems.org"
4
-
5
- gem "rails", github: "rails/rails", branch: "master"
6
- gem "activerecord", github: "rails/rails", branch: "master"
7
- gem "activemodel", github: "rails/rails", branch: "master"
8
- gem "arel", github: "rails/arel", branch: "master"
9
-
10
- gemspec path: "../"
@@ -1,41 +0,0 @@
1
- # -*- encoding: utf-8 -*-
2
-
3
- lib = File.expand_path('../lib', __FILE__)
4
- $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
5
- require 'state_machines/audit_trail/version'
6
-
7
- Gem::Specification.new do |s|
8
- s.name = 'state_machines-audit_trail'
9
- s.version = StateMachines::AuditTrail::VERSION
10
- s.platform = Gem::Platform::RUBY
11
- s.authors = ['Kevin Ross', 'Willem van Bergen', 'Jesse Storimer']
12
- s.email = ['kevin.ross@alienfast.com', 'willem@shopify.com', 'jesse@shopify.com']
13
-
14
- s.homepage = 'https://github.com/state-machines/state_machines-audit_trail'
15
- s.summary = %q{Log transitions on a state_machines to support auditing and business process analytics.}
16
- s.description = %q{Log transitions on a state_machines to support auditing and business process analytics.}
17
- s.license = 'MIT'
18
-
19
- s.add_runtime_dependency('state_machines')
20
-
21
- s.add_development_dependency('state_machines-activerecord')
22
- s.add_development_dependency('state_machines-mongoid')
23
- s.add_development_dependency('rake')
24
- s.add_development_dependency('rspec', '>= 3.0.0')
25
- s.add_development_dependency('activerecord', '>= 5.0.0')
26
- if(defined?(JRUBY_VERSION))
27
- s.add_development_dependency('activerecord-jdbcsqlite3-adapter')
28
- else
29
- s.add_development_dependency('sqlite3')
30
- end
31
- s.add_development_dependency('mongoid', '>= 6.0.0.beta')
32
- s.add_development_dependency('bson')
33
- s.add_development_dependency('generator_spec')
34
- s.add_development_dependency('rails', '>= 5.0.0')
35
- s.add_development_dependency('appraisal', '~> 2.2.0')
36
-
37
- s.files = `git ls-files`.split($/).reject { |f| f =~ /^samples\// }
38
- s.executables = s.files.grep(%r{^bin/}) { |f| File.basename(f) }
39
- s.test_files = s.files.grep(%r{^(test|spec|features)/})
40
- s.require_paths = ['lib']
41
- end