velocity_audited 6.0.1 → 6.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/audited/auditor.rb +4 -1
- data/lib/audited/sweeper.rb +7 -7
- data/lib/audited/version.rb +1 -1
- 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: 7b39436e9380cd8f81939d01bd864c669d65bb033ef97d7c265165160e52809c
|
4
|
+
data.tar.gz: 761804b094627fcb2b13e991ec8eb66288f1761d3d9ba4b134811d3ed399b3b8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ebd15ee11f7c91d2beb3c61db75d6a6c8a3795c8615423d9c9ad9ed9294d321ad5439427adba2a45238318d4e79fa1183a5401250d62ed945b36ee25f03091b6
|
7
|
+
data.tar.gz: 0621c54999850e9a6cd4cbe12642cc1e99ea0e367119aba2a503009f290ea5cc99374dab67d34e2e8c9007a4f51ee660c5429c6607ecc3917fa5bb3260f16bdf
|
data/lib/audited/auditor.rb
CHANGED
@@ -310,6 +310,8 @@ module VelocityAudited
|
|
310
310
|
def write_audit(attrs)
|
311
311
|
self.audit_comment = nil
|
312
312
|
attrs[:db_audit] = true
|
313
|
+
attrs[:record_id] = id
|
314
|
+
attrs[:model] = self.class.base_class.name
|
313
315
|
attrs = add_metadata(attrs)
|
314
316
|
if auditing_enabled
|
315
317
|
attrs[:associated] = send(audit_associated_with) unless audit_associated_with.nil?
|
@@ -321,8 +323,9 @@ module VelocityAudited
|
|
321
323
|
attrs[:client] = ::VelocityAudited.store[:client]
|
322
324
|
attrs[:origin] = ::VelocityAudited.store[:origin]
|
323
325
|
attrs[:user_agent] = ::VelocityAudited.store[:user_agent]
|
324
|
-
attrs[:ip] = ::VelocityAudited.store[:
|
326
|
+
attrs[:ip] = ::VelocityAudited.store[:current_remote_address]
|
325
327
|
attrs[:uid] = ::VelocityAudited.store[:uid]
|
328
|
+
attrs[:request_id] = ::VelocityAudited.store[:request_id]
|
326
329
|
attrs
|
327
330
|
end
|
328
331
|
|
data/lib/audited/sweeper.rb
CHANGED
@@ -8,9 +8,9 @@ module VelocityAudited
|
|
8
8
|
current_user: :current_user,
|
9
9
|
origin: :origin,
|
10
10
|
user_agent: :user_agent,
|
11
|
-
ip: :ip,
|
12
11
|
uid: :uid,
|
13
|
-
client: :client
|
12
|
+
client: :client,
|
13
|
+
request_id: :request_id
|
14
14
|
}
|
15
15
|
|
16
16
|
delegate :store, to: ::VelocityAudited
|
@@ -43,11 +43,7 @@ module VelocityAudited
|
|
43
43
|
def user_agent
|
44
44
|
controller.try(:request).try(:headers)['User-Agent']
|
45
45
|
end
|
46
|
-
|
47
|
-
def ip
|
48
|
-
controller.try(:request).try(:headers)['HTTP_X_FORWARDED_FOR']
|
49
|
-
end
|
50
|
-
|
46
|
+
|
51
47
|
def uid
|
52
48
|
controller.try(:request).try(:headers)['uid']
|
53
49
|
end
|
@@ -56,6 +52,10 @@ module VelocityAudited
|
|
56
52
|
controller.try(:request).try(:headers)['client']
|
57
53
|
end
|
58
54
|
|
55
|
+
def request_id
|
56
|
+
controller.try(:request).try(:uuid)
|
57
|
+
end
|
58
|
+
|
59
59
|
def controller
|
60
60
|
store[:current_controller]
|
61
61
|
end
|
data/lib/audited/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: velocity_audited
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 6.0.
|
4
|
+
version: 6.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Brandon Keepers
|
@@ -14,7 +14,7 @@ authors:
|
|
14
14
|
autorequire:
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
|
-
date:
|
17
|
+
date: 2022-01-11 00:00:00.000000000 Z
|
18
18
|
dependencies:
|
19
19
|
- !ruby/object:Gem::Dependency
|
20
20
|
name: activerecord
|