active_version 1.1.0 → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/lib/active_version/audits/has_audits/change_filters.rb +8 -4
- data/lib/active_version/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: fc38a55e873e8ea603bef6bb4bb15350b03582214fc1a48856a05cb35498b845
|
|
4
|
+
data.tar.gz: 34f0c43fb603e0109729c2254ae6d7ee1f95f14f56f3a0b408ffdb1429efdb48
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: e13a251346e48e51c617961f433f7384f4cb1dce283f41b1cda977180feb1a116a83a83bf39e241bf15d5f7f67daa926dacb19774ee6c496981e9fbc6c49efb7
|
|
7
|
+
data.tar.gz: 0cd3cfe32df95ac78d6591f5127f1a44c340cb69238b77471029fb5827c4d3c946a44c62b7734fe065bbe75db208162b206919254e4ad33addf5f4a3dab39b2c
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
# CHANGELOG
|
|
2
2
|
|
|
3
|
+
## 1.2.0 (2026-03-27)
|
|
4
|
+
|
|
5
|
+
- Fixed SQL generation for audit creation to avoid duplicate `created_at` and `updated_at` columns (or other possible duplicate columns)
|
|
6
|
+
|
|
3
7
|
## 1.1.0 (2026-03-27)
|
|
4
8
|
|
|
5
9
|
- Added `audit_auditable_optional` configuration option to control polymorphic `belongs_to :auditable` optionality
|
|
@@ -104,11 +104,15 @@ module ActiveVersion
|
|
|
104
104
|
end
|
|
105
105
|
|
|
106
106
|
def prepare_sql_values(changes)
|
|
107
|
-
changes.each_with_object({}) do |(k, v),
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
107
|
+
h = changes.each_with_object({}) do |(k, v), acc|
|
|
108
|
+
acc[k] = v.last if v.is_a?(Array)
|
|
109
|
+
acc[k] = v unless v.is_a?(Array)
|
|
110
|
+
acc[k] = JSON.generate(acc[k]) if acc[k].is_a?(Hash) || acc[k].is_a?(Array)
|
|
111
111
|
end
|
|
112
|
+
# Arel INSERT uses keys as column names; stringify so :action / mirror :attrs match
|
|
113
|
+
# string keys from column_mapper and so symbol + string for the same column cannot
|
|
114
|
+
# both appear (PG::DuplicateColumn).
|
|
115
|
+
h.transform_keys(&:to_s)
|
|
112
116
|
end
|
|
113
117
|
end
|
|
114
118
|
end
|