universalid 0.1.4 → 0.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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 86ff30c07adad3183e75fcc333e5fbfe4ff060dae6ad7457fa2d0007f1a24dfa
|
4
|
+
data.tar.gz: 61d5b6fff2f88c78daa6c65797edd56e2770bf253bef8bd14414636b89ae4b76
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 03b04be308330e1ff136354af14cdf961ce33bc689a972f246bc4fe131e81b3aa1d482463827c95291f073a22e3377ab16470bee87e6c6c7ab744b52decea695
|
7
|
+
data.tar.gz: 17533452664536cc5ba5a89437fd877ed7eeaee69ac81354013139d87fd8bde7386b0e087159e455492fc7a402d88ff423ff63e73eb21c51dc84d2389007c2d5
|
data/README.md
CHANGED
@@ -33,7 +33,7 @@
|
|
33
33
|
</a>
|
34
34
|
</p>
|
35
35
|
|
36
|
-
## Fast, recursive,
|
36
|
+
## Fast, recursive, optimized, URL-Safe serialization for any Ruby object
|
37
37
|
|
38
38
|
Universal ID leverages both [MessagePack](https://msgpack.org/) and [Brotli](https://github.com/google/brotli) _(a combo built for speed and best-in-class data compression)_.
|
39
39
|
When combined, these libraries are up to 30% faster and within 2-5% compression rates compared to Protobuf. <a title="Source" href="https://g.co/bard/share/e5bdb17aee91">↗</a>
|
@@ -101,7 +101,7 @@ uid.decode
|
|
101
101
|
|
102
102
|
### Composite Types
|
103
103
|
|
104
|
-
Composite _(or
|
104
|
+
Composite _(or complex, compound, etc.)_ datatype support is where things start to get interesting.
|
105
105
|
Universal ID supports the following native Ruby composite datatypes:
|
106
106
|
|
107
107
|
- `Array`
|
@@ -175,7 +175,7 @@ The following extension datatypes ship with Universal ID:
|
|
175
175
|
> [!IMPORTANT]
|
176
176
|
> **Why Universal ID with ActiveRecord?**
|
177
177
|
> ActiveRecord already has GlobalID, a robust library for serializing individual models.
|
178
|
-
> Universal ID covers a much
|
178
|
+
> **Universal ID covers a much wider range of use cases**.
|
179
179
|
|
180
180
|
Here are a few reasons you may want to consider Universal ID with ActiveRecord.
|
181
181
|
|
@@ -195,7 +195,7 @@ Here are a few reasons you may want to consider Universal ID with ActiveRecord.
|
|
195
195
|
Universal ID gives you control over the serialization process. You can choose which columns to include/exclude, allowing for tailored, optimized payloads to fit your needs.
|
196
196
|
|
197
197
|
- **Queries/Relations**:
|
198
|
-
Universal ID
|
198
|
+
Universal ID also supports ActiveRecord::Relations, enabling the serialization of complex database queries and scopes.
|
199
199
|
|
200
200
|
In summary, while GlobalID excels in its specific use case, Universal ID offers more power for use-cases that involve unsaved records, complex associations, data cloning, and database queries.
|
201
201
|
|
@@ -395,7 +395,7 @@ Fingerprints are comprised of the following components:
|
|
395
395
|
1. `Class (Class)` - The encoded object's class
|
396
396
|
2. `Timestamp (Time)` - The `mtime` (UTC) of the file that defined the object's class
|
397
397
|
|
398
|
-
Fingerprints
|
398
|
+
Fingerprints provide a simple mechanism to help manage data format versions... **minimizing the need for custom versioning solutions**.
|
399
399
|
Whenever the class definition changes, the `mtime` updates, resulting in a different fingerprint.
|
400
400
|
This is especially useful in scenarios where the data format evolves over time, such as in long-lived applications.
|
401
401
|
|
@@ -466,7 +466,7 @@ copy.save #=> true
|
|
466
466
|
```
|
467
467
|
|
468
468
|
> [!TIP]
|
469
|
-
> If you don't need a URL-Safe UID, you can use `UniversalID::Packer` to speed things up.
|
469
|
+
> If you don't need a URL-Safe UID, you can use `UniversalID::Packer` to speed things up a bit.
|
470
470
|
|
471
471
|
```ruby
|
472
472
|
packed = UniversalID::Packer.pack(campaign, options)
|
data/lib/universalid/settings.rb
CHANGED
@@ -39,7 +39,7 @@ class UniversalID::Settings
|
|
39
39
|
in include_keys: include_keys then to.prepack.database.include_keys = !!include_keys
|
40
40
|
in include_timestamps: include_timestamps then to.prepack.database.include_timestamps = !!include_timestamps
|
41
41
|
in include_changes: include_changes then to.prepack.database.include_changes = !!include_changes
|
42
|
-
in include_unsaved_changes: include_changes then to.prepack.database.include_changes = !!
|
42
|
+
in include_unsaved_changes: include_changes then to.prepack.database.include_changes = !!include_changes # TODO: Remove in v1.0
|
43
43
|
in include_descendants: include_descendants then to.prepack.database.include_descendants = !!include_descendants
|
44
44
|
in descendant_depth: descendant_depth then to.prepack.database.descendant_depth = descendant_depth
|
45
45
|
else # ignore key
|
data/lib/universalid/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: universalid
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nate Hopkins (hopsoft)
|
@@ -404,8 +404,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
404
404
|
- !ruby/object:Gem::Version
|
405
405
|
version: '0'
|
406
406
|
requirements: []
|
407
|
-
rubygems_version: 3.
|
407
|
+
rubygems_version: 3.3.21
|
408
408
|
signing_key:
|
409
409
|
specification_version: 4
|
410
|
-
summary: Fast, recursive,
|
410
|
+
summary: Fast, recursive, optimized, URL-Safe serialization for any Ruby object
|
411
411
|
test_files: []
|