rails_surrogate_key_logging 0.6.0 → 1.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: 3c294a79fb780fafbcbc06d116529cb816fd902a52fd1203cfe94ed31fca7ee1
4
- data.tar.gz: 0710ba0071ffaeb46cc18bf8fb8805abed72d39ff4ebf586b605c353ddde9097
3
+ metadata.gz: 59d8e483ef4291595ab8400d078f6b05d806b3f6ff2615742d1b581a339a471b
4
+ data.tar.gz: 45e9c0742590d9b511b9d0895d66243c89271c7b76e583c53886e6ff8c968f9e
5
5
  SHA512:
6
- metadata.gz: ee7d8c9c308fab4691cb7c01a465ce811203ab09db7849977766c84e48d30a8a1f9fdbedcb14add3436cbece9cd63e5c9c838c911c0f7c7a8a81a9c5103d60ef
7
- data.tar.gz: 38fb223db0ae2dbe0f6e3625545c5aee91a3321fe33effda26a366defd0041b482cd4c5f136eb9a0cd4ea3ce5b05e543bb06380bc27387c4e04bc890554715b6
6
+ metadata.gz: abdb1c362e0f5dc3834cbcdf3e72053ff938dc300625ec573d0d2162c3a4039fe0f6ce9ef72b2107a1ad8dba7874189d617893f754e0d07e292b36399b1998d1
7
+ data.tar.gz: 21bada8eb48e7bb83bea8ed5fd982cf41c32ec97f22dfee44330d219a9db61921d89186c59fc0277b85bb29309930e5fa68e4fc0cb003f5a4981a5d3e28527bb
@@ -0,0 +1,40 @@
1
+ # frozen_string_literal: true
2
+
3
+ if defined?(::Sidekiq)
4
+ module Sidekiq
5
+ if defined?(Worker)
6
+ module Worker::ClassMethods
7
+ def surrogate_params(*attrs)
8
+ @surrogate_params ||= []
9
+ attrs.each do |attr|
10
+ @surrogate_params << attr.to_sym
11
+ end
12
+ @surrogate_params
13
+ end
14
+ end
15
+ end
16
+
17
+ if defined?(JobLogger)
18
+ class JobLogger
19
+ alias_method :job_hash_context__before_surrogate_key_logging, :job_hash_context
20
+ def job_hash_context(job_hash)
21
+ hash = job_hash_context__before_surrogate_key_logging(job_hash).stringify_keys
22
+ hash['args'] = {}
23
+ if job_hash.key?('args')
24
+ begin
25
+ klass = hash['class'].constantize
26
+ perform = klass.instance_method(:perform)
27
+ params = perform.parameters
28
+ params.each_with_index do |param, i|
29
+ hash['args'][param.last] = job_hash['args'][i]
30
+ end
31
+ hash['args'] = SurrogateKeyLogging.filter_for_attributes(klass.surrogate_params).filter(hash['args'])
32
+ end
33
+ end
34
+ hash
35
+ end
36
+ end
37
+ end
38
+
39
+ end
40
+ end
@@ -3,8 +3,8 @@
3
3
  module SurrogateKeyLogging
4
4
 
5
5
  module Version
6
- MAJOR = 0
7
- MINOR = 6
6
+ MAJOR = 1
7
+ MINOR = 1
8
8
  PATCH = 0
9
9
 
10
10
  end
@@ -12,12 +12,14 @@ module SurrogateKeyLogging
12
12
  autoload :ActiveRecord
13
13
  autoload :Config, 'surrogate_key_logging/configuration'
14
14
  autoload :Configuration
15
+ autoload :Engine
15
16
  autoload :KeyManager
16
17
  autoload :KeyStore
17
18
  autoload :Middleware
18
- autoload :Engine
19
19
  autoload :Version
20
20
 
21
+ require 'surrogate_key_logging/sidekiq' if defined?(::Sidekiq)
22
+
21
23
  @config = Config.new
22
24
 
23
25
  class << self
@@ -27,8 +27,8 @@ Gem::Specification.new do |s|
27
27
 
28
28
  s.required_ruby_version = '>= 2.7.0'
29
29
 
30
- s.add_dependency('actionpack', '>= 6.0.0', '< 7.0.0')
31
- s.add_dependency('activerecord', '>= 6.0.0', '< 7.0.0')
32
- s.add_dependency('activesupport', '>= 6.0.0', '< 7.0.0')
33
- s.add_dependency('railties', '>= 6.0.0', '< 7.0.0')
30
+ s.add_dependency('actionpack', '>= 6.0.0', '< 8.0.0')
31
+ s.add_dependency('activerecord', '>= 6.0.0', '< 8.0.0')
32
+ s.add_dependency('activesupport', '>= 6.0.0', '< 8.0.0')
33
+ s.add_dependency('railties', '>= 6.0.0', '< 8.0.0')
34
34
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rails_surrogate_key_logging
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.0
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Taylor Yelverton
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-03-20 00:00:00.000000000 Z
11
+ date: 2023-05-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: actionpack
@@ -19,7 +19,7 @@ dependencies:
19
19
  version: 6.0.0
20
20
  - - "<"
21
21
  - !ruby/object:Gem::Version
22
- version: 7.0.0
22
+ version: 8.0.0
23
23
  type: :runtime
24
24
  prerelease: false
25
25
  version_requirements: !ruby/object:Gem::Requirement
@@ -29,7 +29,7 @@ dependencies:
29
29
  version: 6.0.0
30
30
  - - "<"
31
31
  - !ruby/object:Gem::Version
32
- version: 7.0.0
32
+ version: 8.0.0
33
33
  - !ruby/object:Gem::Dependency
34
34
  name: activerecord
35
35
  requirement: !ruby/object:Gem::Requirement
@@ -39,7 +39,7 @@ dependencies:
39
39
  version: 6.0.0
40
40
  - - "<"
41
41
  - !ruby/object:Gem::Version
42
- version: 7.0.0
42
+ version: 8.0.0
43
43
  type: :runtime
44
44
  prerelease: false
45
45
  version_requirements: !ruby/object:Gem::Requirement
@@ -49,7 +49,7 @@ dependencies:
49
49
  version: 6.0.0
50
50
  - - "<"
51
51
  - !ruby/object:Gem::Version
52
- version: 7.0.0
52
+ version: 8.0.0
53
53
  - !ruby/object:Gem::Dependency
54
54
  name: activesupport
55
55
  requirement: !ruby/object:Gem::Requirement
@@ -59,7 +59,7 @@ dependencies:
59
59
  version: 6.0.0
60
60
  - - "<"
61
61
  - !ruby/object:Gem::Version
62
- version: 7.0.0
62
+ version: 8.0.0
63
63
  type: :runtime
64
64
  prerelease: false
65
65
  version_requirements: !ruby/object:Gem::Requirement
@@ -69,7 +69,7 @@ dependencies:
69
69
  version: 6.0.0
70
70
  - - "<"
71
71
  - !ruby/object:Gem::Version
72
- version: 7.0.0
72
+ version: 8.0.0
73
73
  - !ruby/object:Gem::Dependency
74
74
  name: railties
75
75
  requirement: !ruby/object:Gem::Requirement
@@ -79,7 +79,7 @@ dependencies:
79
79
  version: 6.0.0
80
80
  - - "<"
81
81
  - !ruby/object:Gem::Version
82
- version: 7.0.0
82
+ version: 8.0.0
83
83
  type: :runtime
84
84
  prerelease: false
85
85
  version_requirements: !ruby/object:Gem::Requirement
@@ -89,7 +89,7 @@ dependencies:
89
89
  version: 6.0.0
90
90
  - - "<"
91
91
  - !ruby/object:Gem::Version
92
- version: 7.0.0
92
+ version: 8.0.0
93
93
  description: ''
94
94
  email: rubygems@yelvert.io
95
95
  executables: []
@@ -120,6 +120,7 @@ files:
120
120
  - lib/surrogate_key_logging/key_store.rb
121
121
  - lib/surrogate_key_logging/key_store/active_record.rb
122
122
  - lib/surrogate_key_logging/key_store/base.rb
123
+ - lib/surrogate_key_logging/sidekiq.rb
123
124
  - lib/surrogate_key_logging/version.rb
124
125
  - lib/tasks/key_store/active_record.rake
125
126
  - lib/tasks/surrogate_key_logging.rake