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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6b9a886b4b5c2fd7b75b33e9f8d06557da0e51d221bf2c5bee1b88a33a79894e
4
- data.tar.gz: 170d8b76a41e56d68e7ae22d2316cfdfbd4f559c27784a8bfcc0fc2e4e8c713b
3
+ metadata.gz: fc38a55e873e8ea603bef6bb4bb15350b03582214fc1a48856a05cb35498b845
4
+ data.tar.gz: 34f0c43fb603e0109729c2254ae6d7ee1f95f14f56f3a0b408ffdb1429efdb48
5
5
  SHA512:
6
- metadata.gz: b3a6edf6a90368e5a2b65d20439a4b7b2496dc432e75f6ea6a4805b25ac84dfe24155680da924ec3a696ba004d40826382b6547d45ca0769e400c71e14d05eea
7
- data.tar.gz: 30a796563f87edfd7b54e938d2a93b75381e1d494febf1ed51748fcb4d45058d24343f2267275bdf6462d63059bf0fa8ab7f44ef5ac0f8d27e31cea7c765faea
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), h|
108
- h[k] = v.last if v.is_a?(Array)
109
- h[k] = v unless v.is_a?(Array)
110
- h[k] = JSON.generate(h[k]) if h[k].is_a?(Hash) || h[k].is_a?(Array)
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
@@ -1,3 +1,3 @@
1
1
  module ActiveVersion
2
- VERSION = "1.1.0"
2
+ VERSION = "1.2.0"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: active_version
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 1.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrei Makarov