activestorage-nft 0.0.3 → 0.0.4
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/README.md +4 -3
- data/lib/active_storage/service/nft_service.rb +3 -1
- data/lib/active_storage/service/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: 621576ef5625a89648ef4e24111bff5a466d2f5cb40e4aafc0d0bc2fca0560de
|
|
4
|
+
data.tar.gz: 79f77aac7c49fb69100852ae64347ca252ad9351e871a11b4e0cc774344dd6d8
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 6d4f0fcebf20d477fa1acf7266a4d80401f6f9b146a4093d9d41bfc1649bec48ab9565ca2d8ab50539aa18739bf850587e029c74c967030ff10f575abdc8df44
|
|
7
|
+
data.tar.gz: a9281cbb5cbb39d50f74fe90ea385920fedd196863b785fbc27a058f54887eb89feca0a061df563ab6f6631ff94a25eb0cb647b482aefbee8bcb6f2f36660e80
|
data/README.md
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
# Activestorage::Nft
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
[NFT.storage](https://nft.storage).
|
|
3
|
+
ActiveStorage adapter for [NFT.storage](https://nft.storage).
|
|
5
4
|
|
|
6
|
-
|
|
5
|
+
Uploaded files are automatically pinned on the pinata.cloud IPFS pinning service, courtesey of [Protocol Labs](https://protocol.ai).
|
|
6
|
+
|
|
7
|
+
Please note: This adapter adds a `unique` validation on ActiveRecord::Blob and will raise a validation error when trying to upload a file that already exists.
|
|
7
8
|
|
|
8
9
|
## Installation
|
|
9
10
|
|
|
@@ -18,7 +18,9 @@ module ActiveStorage
|
|
|
18
18
|
def upload(key, io, checksum: nil, **)
|
|
19
19
|
instrument :upload, key: key, checksum: checksum do
|
|
20
20
|
cid_key = @client.add io.path
|
|
21
|
-
Blob.find_by_key(key)
|
|
21
|
+
blob = Blob.find_by_key(key)
|
|
22
|
+
blob.key = cid_key
|
|
23
|
+
blob.save!
|
|
22
24
|
end
|
|
23
25
|
end
|
|
24
26
|
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: activestorage-nft
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.0.
|
|
4
|
+
version: 0.0.4
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Stefan Buhrmester
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2021-11-
|
|
11
|
+
date: 2021-11-14 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: http
|