historiographer 4.1.4 → 4.1.5
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/lib/historiographer/version.rb +1 -1
- data/lib/historiographer.rb +5 -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: d5c265010aca1b01c9eda903723571b16456965c208879096542e9aadad079df
|
4
|
+
data.tar.gz: 59553cbf0764e820570dcb2bce9f6f6188d6920f16f0bf4fbb0cf5c4bb6ea52b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0fc94e06266d5d21d28c4521e5ee9da3f90af4cbcea5594814b1916474929b42f4db37907acf0c104477b98db8e4f78082887a24f9495b7699b237f11bc1c9f9
|
7
|
+
data.tar.gz: 4b819a457d62ac154994b445b88ed7574341d4a366a24318ca64708d110d1081b6fb1032a9d505115b47eaffaf1efcc6e2bdabe39a56153c345ebcb8a8e57934
|
data/lib/historiographer.rb
CHANGED
@@ -342,7 +342,7 @@ module Historiographer
|
|
342
342
|
|
343
343
|
# Recursively snapshot associations, avoiding infinite loops
|
344
344
|
self.class.reflect_on_all_associations.each do |association|
|
345
|
-
associated_records = send(association.name)
|
345
|
+
associated_records = send(association.name)&.reload
|
346
346
|
Array(associated_records).each do |record|
|
347
347
|
model_name = record.class.name
|
348
348
|
record_id = record.id
|
@@ -383,6 +383,10 @@ module Historiographer
|
|
383
383
|
attrs
|
384
384
|
end
|
385
385
|
|
386
|
+
def latest_snapshot
|
387
|
+
histories.where.not(snapshot_id: nil).order('id DESC').limit(1)&.first || none
|
388
|
+
end
|
389
|
+
|
386
390
|
private
|
387
391
|
|
388
392
|
def history_user_absent_action
|