avo-diff_field 0.0.4 → 0.0.5

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: 81dd10a1bf80eb260edb069cb2f3980950788d78e9e4c4c70da7f0b684d238a6
4
- data.tar.gz: 7629f9c59c58d0fd21e22667ab3eea630755e0b87b910859cb6c578cfd47fabb
3
+ metadata.gz: 326f82963839a5c6f49a2cc75ee0e5f28776beae69ece2b0b8d20080bc6b0d86
4
+ data.tar.gz: a0526c97e121e031976fa601fbdd96714027ec27db62cb859ccddba208b35aed
5
5
  SHA512:
6
- metadata.gz: 68ae3563cd16900dec9b1952843546cc9685f3474f5cc6c82ad61fca0991f93747567019fd68153dfc55c4824f214763a7175d23dd4629c8160b151dc7b2de67
7
- data.tar.gz: 8c51c749e6e1bd93699ff2c3cd1ef46ec1cb8ab9cdd86b680cac2ddf6678bd3aa48c2a6d66c9d00e4fd5989a68e371a8a0d3590e6d4cb72f09af7cc04de5a621
6
+ metadata.gz: cf014d6a93c367ded3c86eda31dc7556ec64b95d450cb71d66c7155c26e96db704abd7808829431c7547b5eb6a8268d3fe7ec69991f40befb3588f589c052ecd
7
+ data.tar.gz: baa196150a3a49f500a9dcaa6ec0be2b2fe88337466ac7348cf47739e3a877eb8feaf12dd521e0f6a9df2258f59512936a4fc5c287c73ef4567d55c79024db75
@@ -4,22 +4,21 @@ class Avo::DiffField::Fields::DiffField::ShowComponent < Avo::Fields::ShowCompon
4
4
  def initialize **args
5
5
  super(**args)
6
6
  @diffy_value = @field.value&.map do |k, v|
7
- if @field.record.class == "PaperTrail::Version".safe_constantize
8
- left_value = v[0]
9
- right_value = v[1]
10
- elsif @field.record.class == "Audited::Audit".safe_constantize
11
- case @field.record.action
12
- when 'update'
13
- left_value = v[0]
14
- right_value = v[1]
15
- when 'destroy'
16
- left_value = v
17
- right_value = ''
18
- when 'create'
19
- left_value = ''
20
- right_value = v
21
- end
22
- end
7
+ left_value = v[0]
8
+ right_value = v[1]
9
+ # Logic for audited:
10
+ # case action
11
+ # when 'update'
12
+ # left_value = v[0]
13
+ # right_value = v[1]
14
+ # when 'destroy'
15
+ # left_value = v
16
+ # right_value = ''
17
+ # when 'create'
18
+ # left_value = ''
19
+ # right_value = v
20
+ # end
21
+ # end
23
22
 
24
23
  [k, Diffy::Diff.new(left_value.to_s, right_value.to_s, format: :html, include_plus_and_minus_in_html: true)]
25
24
  end
@@ -1,5 +1,5 @@
1
1
  module Avo
2
2
  module DiffField
3
- VERSION = "0.0.4" unless const_defined?(:VERSION)
3
+ VERSION = "0.0.5" unless const_defined?(:VERSION)
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: avo-diff_field
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Adrian Marin
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-10-28 00:00:00.000000000 Z
11
+ date: 2024-11-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: diffy