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 +4 -4
- data/lib/avo/diff_field/fields/diff_field/show_component.rb +15 -16
- data/lib/avo/diff_field/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: 326f82963839a5c6f49a2cc75ee0e5f28776beae69ece2b0b8d20080bc6b0d86
|
4
|
+
data.tar.gz: a0526c97e121e031976fa601fbdd96714027ec27db62cb859ccddba208b35aed
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
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
|
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
|
+
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-
|
11
|
+
date: 2024-11-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: diffy
|