alchemy-dragonfly-s3 6.0.0 → 6.0.1
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/alchemy/dragonfly/s3/create_picture_thumb.rb +6 -8
- data/lib/alchemy/dragonfly/s3/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: db1e5c08edd7be1ceba98fb77b3882a31f2bdf49b665eed978cfeff75d87163d
|
4
|
+
data.tar.gz: 354c096e7451931b3db43cc949cf73a1c54a13b389a8707af496c17f0cf85157
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a928b88710af67671e36de32a46a68bb3cfdb59198b41dbdddd8eb5ecf3530c6bef7ce43ce8452b7af0a7dbff259269a1e22a3b70be0aadabd37353262fdc1f8
|
7
|
+
data.tar.gz: cdfc3fafb942ec4645f60760521c3c2bb19e8494c42697da1e4f0812fcbb18c1545fd6c7fd781fcfbc42b1449db970e1f04c62718a0837a5811ae071cd7d9027
|
data/CHANGELOG.md
CHANGED
@@ -5,15 +5,13 @@ module Alchemy
|
|
5
5
|
module S3
|
6
6
|
class CreatePictureThumb
|
7
7
|
def self.call(variant, signature, uid)
|
8
|
+
return if !variant.picture.valid?
|
9
|
+
|
8
10
|
# create the thumb before uploading
|
9
11
|
# to prevent db race conditions
|
10
|
-
thumb =
|
11
|
-
|
12
|
-
thumb =
|
13
|
-
picture: variant.picture,
|
14
|
-
signature: signature,
|
15
|
-
uid: uid,
|
16
|
-
)
|
12
|
+
@thumb = Alchemy::PictureThumb.create_or_find_by!(signature: signature) do |thumb|
|
13
|
+
thumb.picture = variant.picture
|
14
|
+
thumb.uid = uid
|
17
15
|
end
|
18
16
|
begin
|
19
17
|
# fetch and process the image
|
@@ -23,7 +21,7 @@ module Alchemy
|
|
23
21
|
rescue RuntimeError, Excon::Error => e
|
24
22
|
ErrorTracking.notification_handler.call(e)
|
25
23
|
# destroy the thumb if processing or upload fails
|
26
|
-
thumb&.destroy
|
24
|
+
@thumb&.destroy
|
27
25
|
end
|
28
26
|
end
|
29
27
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: alchemy-dragonfly-s3
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 6.0.
|
4
|
+
version: 6.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Thomas von Deyen
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-
|
11
|
+
date: 2023-02-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: alchemy_cms
|