uuid_v7 0.1.4 → 0.1.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/lib/uuid_v7/types/sqlite_type.rb +10 -2
- data/lib/uuid_v7/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b03f6464dc27d2ca7f41c132d4d69064e70cb06edfac6f25b4f9ac6a3a60ca99
|
4
|
+
data.tar.gz: ee687a53b8432216dcaa3145d4535bfc50a86bebbffdc0fa90c3f56f3eeda9ac
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fb064229af5d3945159946211e6f34a07395a6c8e0eb772af3d181d893783c96c560e14397d6071523a40119092709bb4ae02eaf9fe8f8ffd6bf8ab25398aebb
|
7
|
+
data.tar.gz: c9b7a3c09120b189eab096d07cf4afe23193706d23507270c27b627f0910615c694929baa0425999ee96a2e53f0c80dff6fd67f770a3f418d81460fbbfc3ec53
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,9 @@
|
|
1
1
|
## [Unreleased]
|
2
2
|
|
3
|
+
## [0.1.5] - 2024-07-15
|
4
|
+
|
5
|
+
- Rails 8.0 brings some changes, the data is correctly recorded as BINARY in SQLite, so we can simplify the code, but too stay compatible the code is less simple.
|
6
|
+
|
3
7
|
## [0.1.4] - 2024-07-10
|
4
8
|
|
5
9
|
- Relax Gem Spec Constraints
|
@@ -5,11 +5,19 @@ require_relative "base"
|
|
5
5
|
module UuidV7
|
6
6
|
module Types
|
7
7
|
class SqliteType < Base
|
8
|
-
# SQLite does not return binary data, it returns a String, no need to unpack it.
|
8
|
+
# In some configuration SQLite does not return binary data, it returns a String, in that case no need to unpack it.
|
9
|
+
# However, in some other configurations, it returns binary data, in that case we need to unpack it. activemodel (8.0.0)
|
10
|
+
# Note: If you are using SQLite3 >= 2.2, and Rails >= 8.0 you can get rid of this method all together.
|
9
11
|
def deserialize(value)
|
10
12
|
return unless value
|
11
13
|
|
12
|
-
|
14
|
+
if value.is_a?(String) && value.encoding == Encoding::ASCII_8BIT && !value.match?(/\A\h{8}\h{4}\h{4}\h{4}\h{12}\z/)
|
15
|
+
# The value is binary encoded; unpack it
|
16
|
+
cast(value.unpack1("H*"))
|
17
|
+
else
|
18
|
+
# The value is a plain hex string; use it directly
|
19
|
+
cast(value)
|
20
|
+
end
|
13
21
|
end
|
14
22
|
end
|
15
23
|
end
|
data/lib/uuid_v7/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: uuid_v7
|
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
|
- Joel Azemar
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-11-
|
11
|
+
date: 2024-11-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activemodel
|