structify 0.3.1 → 0.3.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: 4fbeb1c01044934870011f48445f8e6f16eeaef8f05c8494f3b091fdd653cef5
4
- data.tar.gz: c26b11296ffb7d3443fd987372b0190b56b1663e612853ee085da4a312d2caaf
3
+ metadata.gz: 16e507a19675f16dfdfdb0b4fe45b26552d208edf4bc69a7a4e488d9f6e179b9
4
+ data.tar.gz: 71a8122d19560c75032dbcb3108404eebfd6cc1177e8acd7a1d357b1a280baa3
5
5
  SHA512:
6
- metadata.gz: 92e66ce5f01fc08608407df5042c50ea15aec7a8f150b58ad65bfc162a2af0dbc8341a964b51c0f6b2e188c9d9bfe3514e44f8d7930edcfd466ae66d16c2504c
7
- data.tar.gz: e5df0c18b158393df16f61321bb6f56694e811591da44de748d0ff287a0007b61395678031e70d18f7d06fbed90b4c3e4eedd6eb4143cc9e37ecfe5e34266a6f
6
+ metadata.gz: 9f7aa82f582fc526bd2b022cb143bf5cb1abf4bbd6be4f23ee8c8c4a156b048092d4f66b41329b37c56e060ef1869378bc0e79f5751316aaaa728f3401cb5d73
7
+ data.tar.gz: f748095a76f2532641414961b331ecb66ff73f57faa61550db9b4537d760c54b55adab04f89f28a744b391608b21d4ee45c1dea1e8e34cd7b5b6df6c89a74dab
data/CHANGELOG.md CHANGED
@@ -2,6 +2,12 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file.
4
4
 
5
+ ## [0.3.2] - 2025-03-17
6
+
7
+ ### Added
8
+
9
+ - Added `saved_change_to_extracted_data?` method that works with the configured `default_container_attribute`
10
+
5
11
  ## [0.3.0] - 2025-03-17
6
12
 
7
13
  ### Added
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- structify (0.3.0)
4
+ structify (0.3.1)
5
5
  activesupport (>= 7.0, < 9.0)
6
6
  attr_json (~> 2.1)
7
7
 
@@ -49,6 +49,19 @@ module Structify
49
49
  record_data["version"] || 1
50
50
  end
51
51
 
52
+ # Check if the extracted data has been changed since the record was last saved
53
+ # Respects the default_container_attribute configuration
54
+ #
55
+ # This provides a consistent method to check for changes regardless of the
56
+ # container attribute name that was configured.
57
+ #
58
+ # @return [Boolean] Whether the extracted data has changed
59
+ def saved_change_to_extracted_data?
60
+ container_attribute = self.class.attr_json_config.default_container_attribute
61
+ respond_to?("saved_change_to_#{container_attribute}?") &&
62
+ self.send("saved_change_to_#{container_attribute}?")
63
+ end
64
+
52
65
  # Check if a version is within a given range/array of versions
53
66
  # This is used in field accessors to check version compatibility
54
67
  #
@@ -1,3 +1,3 @@
1
1
  module Structify
2
- VERSION = "0.3.1"
2
+ VERSION = "0.3.2"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: structify
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.1
4
+ version: 0.3.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kieran Klaassen