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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 16d06e2db5a0f241680b03f00ea18dd1be63bbbac5012e7f01c1222bd2203a11
4
- data.tar.gz: ebb4a1d5c04de38769514698513771dd8ef3d795b92b6b4c9caac84c2e3f1973
3
+ metadata.gz: 7b39436e9380cd8f81939d01bd864c669d65bb033ef97d7c265165160e52809c
4
+ data.tar.gz: 761804b094627fcb2b13e991ec8eb66288f1761d3d9ba4b134811d3ed399b3b8
5
5
  SHA512:
6
- metadata.gz: 72800d67eae10d4ca2ea18df5204edd747fcaa4d3d9009259df035ba44f10c4d3b876dc705ae932b827922ee2c45e734157ba830c01ed43718dd1eb7f03ad4d4
7
- data.tar.gz: 71b6eb0a64c888b71ef1aa9edbeb0dcb2b4fd0161f00d9b55910bd33513cf37c6bea1519aa86d13dc5668a4b577d2f73c6d3d4f9bff29e6f87bf9094ffc15d5a
6
+ metadata.gz: ebd15ee11f7c91d2beb3c61db75d6a6c8a3795c8615423d9c9ad9ed9294d321ad5439427adba2a45238318d4e79fa1183a5401250d62ed945b36ee25f03091b6
7
+ data.tar.gz: 0621c54999850e9a6cd4cbe12642cc1e99ea0e367119aba2a503009f290ea5cc99374dab67d34e2e8c9007a4f51ee660c5429c6607ecc3917fa5bb3260f16bdf
@@ -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[:ip]
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
 
@@ -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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module VelocityAudited
4
- VERSION = "6.0.1"
4
+ VERSION = "6.0.3"
5
5
  end
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.1
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: 2021-12-29 00:00:00.000000000 Z
17
+ date: 2022-01-11 00:00:00.000000000 Z
18
18
  dependencies:
19
19
  - !ruby/object:Gem::Dependency
20
20
  name: activerecord