active_snapshot 1.2.1 → 1.2.2

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: ee649f66f2e086bbef5720bccb6987ede52b70cb8eac983e1fc1cd29338d13fe
4
- data.tar.gz: f9e5be06846f445c533dbe85a569a2be47d83f35c1ad38402b9778d0f4b52562
3
+ metadata.gz: e0b152becdbe73c72a5db7316f792dd4158d4bb2306bf75937e95477d123104d
4
+ data.tar.gz: e0d0a4f27d41335f464f1f324e3f14cd884b8a44f6920bef29a19575ee6711d7
5
5
  SHA512:
6
- metadata.gz: 43e4edaf15e318014f9c97b2425bf4d92f23e3f9c162ce0dc1b91712d0d98d448ae6002ed833186287603fb0e1c7bf675b9242f66b0a9d8ce760cd62f3296494
7
- data.tar.gz: edff53f7b93136a6dbbd70625b17cd0a1b14b40fff67a15bf57af065c92d8e54d626ffa4de5268e166f9bad8dc350a48ed453d97dca9d1b89361f98e0f7f3cd7
6
+ metadata.gz: 86659f86b9fccc9d8a46bfff96db1d515117838db382d520cee5d7d94292438ac4228be35359744ff14de86038545d58af187019f6a6e4c18e9b380129be0a5a
7
+ data.tar.gz: a543fb2fd4323ccd0dd78e25f8b59e6df9660a9b11373b846ae72962aff00fd83f79d796213076a0f5ee2f7c00f2faf3bcdc96b8a3e97c5faaa67cef799f83a1
data/CHANGELOG.md CHANGED
@@ -2,9 +2,13 @@ CHANGELOG
2
2
  ---------
3
3
 
4
4
  - **Unreleased**
5
- * [View Diff](https://github.com/westonganger/active_snapshot/compare/v1.2.1...master)
5
+ * [View Diff](https://github.com/westonganger/active_snapshot/compare/v1.2.2...master)
6
6
  * Nothing yet
7
7
 
8
+ - **v1.2.2** - Sept 11, 2026
9
+ * [View Diff](https://github.com/westonganger/active_snapshot/compare/v1.2.1...v1.2.2)
10
+ * [#86](https://github.com/westonganger/active_snapshot/pull/86) - Fix reification of enum attributes stored as labels by snapshots from gem versions <= 0.4.x
11
+
8
12
  - **v1.2.1** - July 24, 2026
9
13
  * [View Diff](https://github.com/westonganger/active_snapshot/compare/v1.2.0...v1.2.1)
10
14
  * [#82](https://github.com/westonganger/active_snapshot/pull/82) - Properly serialize PostgreSQL array columns
@@ -1,3 +1,3 @@
1
1
  module ActiveSnapshot
2
- VERSION = "1.2.1".freeze
2
+ VERSION = "1.2.2".freeze
3
3
  end
@@ -18,7 +18,15 @@ module ActiveSnapshot
18
18
  return value if value.nil?
19
19
 
20
20
  begin
21
- klass.attribute_types[key].deserialize(value)
21
+ if klass.respond_to?(:defined_enums) && klass.defined_enums.key?(key)
22
+ # Snapshots created with gem versions <= 0.4.x stored enum attributes as their
23
+ # label (e.g. "published"), newer versions store the database value. `deserialize`
24
+ # expects the database value and would silently turn a label into the enum's
25
+ # first value (e.g. "published".to_i => 0 => "draft"), `cast` accepts both.
26
+ klass.attribute_types[key].cast(value)
27
+ else
28
+ klass.attribute_types[key].deserialize(value)
29
+ end
22
30
  rescue ActiveRecord::Encryption::Errors::Base
23
31
  # handle columns which are changed from non-encrypted to encrypted
24
32
  value
metadata CHANGED
@@ -1,14 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: active_snapshot
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.1
4
+ version: 1.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Weston Ganger
8
- autorequire:
9
8
  bindir: bin
10
9
  cert_chain: []
11
- date: 2026-07-24 00:00:00.000000000 Z
10
+ date: 1980-01-02 00:00:00.000000000 Z
12
11
  dependencies:
13
12
  - !ruby/object:Gem::Dependency
14
13
  name: activerecord
@@ -148,7 +147,6 @@ licenses:
148
147
  metadata:
149
148
  source_code_uri: https://github.com/westonganger/active_snapshot
150
149
  changelog_uri: https://github.com/westonganger/active_snapshot/blob/master/CHANGELOG.md
151
- post_install_message:
152
150
  rdoc_options: []
153
151
  require_paths:
154
152
  - lib
@@ -163,8 +161,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
163
161
  - !ruby/object:Gem::Version
164
162
  version: '0'
165
163
  requirements: []
166
- rubygems_version: 3.4.22
167
- signing_key:
164
+ rubygems_version: 4.0.3
168
165
  specification_version: 4
169
166
  summary: Dead simple snapshot versioning for ActiveRecord models and associations.
170
167
  test_files: []