alchemy-dragonfly-s3 5.2.0 → 5.2.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 +8 -7
- data/lib/alchemy/dragonfly/s3/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f2741b9d0809ea0db39de700b0ca1b1181deec6d59606737c7620ec96faadf66
|
4
|
+
data.tar.gz: c8ce3d82fb9a790f2719ebeb39e69547602e68336e6ec345306b0c570c682aa5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: dffd05e4c6da9a3ceb21895c71c042e07ded2a7a8bd6556bfefeffa40af34a9ece18017050755f435ce34d1ae354dbcfe6d77dc5153b0a5e91d381d886d49821
|
7
|
+
data.tar.gz: 80e574fdc5b74a76d1278bf9b809ceb56b19778e76acf485afc76a914c7e3559ab7ab81c447b0c0c6f985bc7fdfdc894fc612816df7932168a32d3a1e87e4dab
|
data/CHANGELOG.md
CHANGED
@@ -5,22 +5,23 @@ 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
|
-
picture
|
12
|
-
|
13
|
-
|
14
|
-
)
|
12
|
+
@thumb = Alchemy::PictureThumb.create_or_find_by!(signature: signature) do |thumb|
|
13
|
+
thumb.picture = variant.picture
|
14
|
+
thumb.uid = uid
|
15
|
+
end
|
15
16
|
begin
|
16
17
|
# fetch and process the image
|
17
18
|
image = variant.image
|
18
19
|
# upload the processed image
|
19
20
|
image.store(path: uid)
|
20
21
|
rescue RuntimeError, Excon::Error => e
|
21
|
-
|
22
|
+
ErrorTracking.notification_handler.call(e)
|
22
23
|
# destroy the thumb if processing or upload fails
|
23
|
-
thumb
|
24
|
+
@thumb&.destroy
|
24
25
|
end
|
25
26
|
end
|
26
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: 5.2.
|
4
|
+
version: 5.2.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:
|
11
|
+
date: 2023-02-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: alchemy_cms
|
@@ -122,7 +122,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
122
122
|
- !ruby/object:Gem::Version
|
123
123
|
version: '0'
|
124
124
|
requirements: []
|
125
|
-
rubygems_version: 3.
|
125
|
+
rubygems_version: 3.3.26
|
126
126
|
signing_key:
|
127
127
|
specification_version: 4
|
128
128
|
summary: AlchemyCMS Dragonfly S3.
|