active_snapshot 0.2.3 → 0.2.4
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 +8 -3
- data/README.md +1 -1
- data/lib/active_snapshot/models/concerns/snapshots_concern.rb +1 -3
- data/lib/active_snapshot/models/snapshot.rb +1 -1
- data/lib/active_snapshot/version.rb +1 -1
- data/test/dummy_app/app/models/parent_without_children.rb +5 -0
- data/test/dummy_app/app/models/sub_post.rb +11 -0
- data/test/dummy_app/db/test.sqlite3 +0 -0
- data/test/dummy_app/log/test.log +2463 -1181
- data/test/models/snapshot_test.rb +31 -0
- data/test/models/snapshots_concern_test.rb +1 -3
- metadata +35 -31
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 204744938dec9e53545cc73a6497d47b9463b76b0622491d442b5ed4169b7c83
|
4
|
+
data.tar.gz: dee647e71ff99f91e79764f6094e9253fa74b9641e6f2e611ea10485e3d1d570
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fe9542a0beecba0f52d3d25f0dfbd1197f31eb4ab9758f7ccfaf0e5455dfd150ef6ee1ba81fc138383ff8004a9e26a037a6ad72c004766bac1f0a3bf68edb4e6
|
7
|
+
data.tar.gz: eeab5ae90f2dc09f34ece44aa51992df834cf552693849d4595554e08448d4d8fceac954cb5ccbbe47089b1a868eeb089b5391ed3cf8a410aad6d436e6a3ef6a
|
data/CHANGELOG.md
CHANGED
@@ -2,12 +2,17 @@ CHANGELOG
|
|
2
2
|
---------
|
3
3
|
|
4
4
|
- **UNRELEASED**
|
5
|
-
* [View Diff](https://github.com/westonganger/active_snapshot/compare/v0.2.
|
5
|
+
* [View Diff](https://github.com/westonganger/active_snapshot/compare/v0.2.4...master)
|
6
6
|
* Nothing yet
|
7
7
|
|
8
|
-
- **
|
8
|
+
- **v0.2.4** - Feb 25, 2022
|
9
|
+
* [View Diff](https://github.com/westonganger/active_snapshot/compare/v0.2.3...v0.2.4)
|
10
|
+
* [PR #20](https://github.com/westonganger/active_snapshot/pull/20) - Resolve error when `has_snapshot_children` has not been defined as it should be optional
|
11
|
+
* [PR #18](https://github.com/westonganger/active_snapshot/pull/18) - Fix bug where sub-classes of a model would not be assigned correctly as parent when restoring
|
12
|
+
|
13
|
+
- **v0.2.3** - Jan 7, 2022
|
9
14
|
* [View Diff](https://github.com/westonganger/active_snapshot/compare/v0.2.2...v0.2.3)
|
10
|
-
* Support Ruby 3.1
|
15
|
+
* Support Ruby 3.1 using `YAML.unsafe_load`
|
11
16
|
* Fix unique constraint on snapshots.identifier column
|
12
17
|
|
13
18
|
- **v0.2.2** - August 27, 2021
|
data/README.md
CHANGED
@@ -38,9 +38,7 @@ module ActiveSnapshot
|
|
38
38
|
class_methods do
|
39
39
|
|
40
40
|
def has_snapshot_children(&block)
|
41
|
-
if
|
42
|
-
raise ArgumentError.new("Invalid `has_snapshot_children` requires block to be defined")
|
43
|
-
elsif block_given?
|
41
|
+
if block_given?
|
44
42
|
@snapshot_children_proc = block
|
45
43
|
else
|
46
44
|
@snapshot_children_proc
|
@@ -98,7 +98,7 @@ module ActiveSnapshot
|
|
98
98
|
|
99
99
|
reified_children_hash[key] << reified_item
|
100
100
|
|
101
|
-
elsif
|
101
|
+
elsif self.item_id == si.item_id && (self.item_type == si.item_type || si.item_type.constantize.new.is_a?(self.item_type.constantize))
|
102
102
|
reified_parent = reified_item
|
103
103
|
end
|
104
104
|
end
|
Binary file
|