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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7dda2bcfde58be6c1c02fb5f86399ff9d511e450a425627aeafc3c55365e3916
4
- data.tar.gz: 46ef8a1d47ab0d6fcc960ef949fc126fd5b1cc620029d1815ef98ceda973e0fe
3
+ metadata.gz: 6c04f87359f676125c3e3277b9828325a7f6d4ed495a89f6c993aa2c2205f1d8
4
+ data.tar.gz: 27e87f850f294c3a264082312f5aeba0f4fb7682456bfbebf55e65d6829ba341
5
5
  SHA512:
6
- metadata.gz: 3aab4924b91d8e53c5abb59babf7d477b799eb75ae074b4d10ed1f883a45a616be7dc898888335c298101be8a72288b3266cc4ec643fa4ad21cd5deadc5a6654
7
- data.tar.gz: 27f4f2744a24b2b63d89617e5bd9d872b9a8f38c587ca4c7b05c1925c5d1e155efaf650a851f1a31f6fd4a9dba5ceaea31379407453f62ed0204cff656fc6bc5
6
+ metadata.gz: a485e2b7326beaa33011351c46359ed5de64ebbba15178f3ab678fb2d481f2c4cba1126e80209aee3d46fcb7d2b15486b6379e68f714abc8e0887475817ffcb1
7
+ data.tar.gz: 7a30e4b192e8e8883ce04e302decbfc48f8f96e6e97b48d0cb7f880ea953ea529458e9f0501f1003cfafa89cf0d1f0e8bb73c7246a039414baed92c8ce27cc4e
@@ -29,5 +29,4 @@ Gem::Specification.new do |spec|
29
29
  spec.require_paths = ["lib"]
30
30
 
31
31
  spec.add_dependency 'http', '~> 4.3'
32
- spec.add_dependency 'nft_storage', '~> 1.0.0'
33
32
  end
@@ -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
 
@@ -1,5 +1,5 @@
1
1
  module ActiveStorage
2
2
  module NftService
3
- VERSION = '0.0.2'.freeze
3
+ VERSION = '0.0.3'.freeze
4
4
  end
5
5
  end
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.2
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