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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ec4560a7984db99bb67a91f6ed46ffd5e0e0b68b208b9f5c56079d5d0c967c06
4
- data.tar.gz: 558f4f69363da666c55ad58bdf4aa1108e405c96d54e2ae4d96f4d7baa87e4a0
3
+ metadata.gz: d5c265010aca1b01c9eda903723571b16456965c208879096542e9aadad079df
4
+ data.tar.gz: 59553cbf0764e820570dcb2bce9f6f6188d6920f16f0bf4fbb0cf5c4bb6ea52b
5
5
  SHA512:
6
- metadata.gz: 803285240c47f720ae89ba027d1143e7b0e63ed765bb26399b7d126e2c04449664604a7488553f8996f89c3736d86909ed52702fcc5fb4bf7df2cb2fa5de4a44
7
- data.tar.gz: 263c7cd005f3cd3589a1ed47c62d7127844686c5b945e1835995b99151b0bbceb6b72c86bac80e09b17efde796e3eeef2b34a0d9f33fb99945915e14b1c9aef8
6
+ metadata.gz: 0fc94e06266d5d21d28c4521e5ee9da3f90af4cbcea5594814b1916474929b42f4db37907acf0c104477b98db8e4f78082887a24f9495b7699b237f11bc1c9f9
7
+ data.tar.gz: 4b819a457d62ac154994b445b88ed7574341d4a366a24318ca64708d110d1081b6fb1032a9d505115b47eaffaf1efcc6e2bdabe39a56153c345ebcb8a8e57934
@@ -1,3 +1,3 @@
1
1
  module Historiographer
2
- VERSION = "4.1.4"
2
+ VERSION = "4.1.5"
3
3
  end
@@ -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).reload
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
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: historiographer
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.1.4
4
+ version: 4.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - brettshollenberger