activestorage-nft 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/activestorage-nft.gemspec +0 -1
- data/lib/active_storage/service/nft_service.rb +5 -2
- data/lib/active_storage/service/version.rb +1 -1
- metadata +1 -15
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6c04f87359f676125c3e3277b9828325a7f6d4ed495a89f6c993aa2c2205f1d8
|
4
|
+
data.tar.gz: 27e87f850f294c3a264082312f5aeba0f4fb7682456bfbebf55e65d6829ba341
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a485e2b7326beaa33011351c46359ed5de64ebbba15178f3ab678fb2d481f2c4cba1126e80209aee3d46fcb7d2b15486b6379e68f714abc8e0887475817ffcb1
|
7
|
+
data.tar.gz: 7a30e4b192e8e8883ce04e302decbfc48f8f96e6e97b48d0cb7f880ea953ea529458e9f0501f1003cfafa89cf0d1f0e8bb73c7246a039414baed92c8ce27cc4e
|
data/activestorage-nft.gemspec
CHANGED
@@ -1,5 +1,9 @@
|
|
1
1
|
require 'nft/client'
|
2
2
|
|
3
|
+
class ActiveStorage::Blob
|
4
|
+
validates :key, uniqueness: true
|
5
|
+
end
|
6
|
+
|
3
7
|
module ActiveStorage
|
4
8
|
class Service::NftService < Service
|
5
9
|
attr_accessor :client
|
@@ -14,8 +18,7 @@ module ActiveStorage
|
|
14
18
|
def upload(key, io, checksum: nil, **)
|
15
19
|
instrument :upload, key: key, checksum: checksum do
|
16
20
|
cid_key = @client.add io.path
|
17
|
-
|
18
|
-
Blob.find_by_key(key).update key: cid_key
|
21
|
+
Blob.find_by_key(key).update! key: cid_key
|
19
22
|
end
|
20
23
|
end
|
21
24
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
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.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Stefan Buhrmester
|
@@ -24,20 +24,6 @@ dependencies:
|
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '4.3'
|
27
|
-
- !ruby/object:Gem::Dependency
|
28
|
-
name: nft_storage
|
29
|
-
requirement: !ruby/object:Gem::Requirement
|
30
|
-
requirements:
|
31
|
-
- - "~>"
|
32
|
-
- !ruby/object:Gem::Version
|
33
|
-
version: 1.0.0
|
34
|
-
type: :runtime
|
35
|
-
prerelease: false
|
36
|
-
version_requirements: !ruby/object:Gem::Requirement
|
37
|
-
requirements:
|
38
|
-
- - "~>"
|
39
|
-
- !ruby/object:Gem::Version
|
40
|
-
version: 1.0.0
|
41
27
|
description: A ActiveStorage Service
|
42
28
|
email:
|
43
29
|
- stefan@moogical.dev
|