active_storage-cloud_transformations 0.2.0 → 0.2.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/config/initializers/active_storage-cloud_transformations.rb +1 -1
- data/gemfiles/rails_6.1.gemfile.lock +1 -1
- data/gemfiles/rails_7.0.gemfile.lock +1 -1
- data/lib/active_storage/cloud_transformations/preview.rb +2 -2
- data/lib/active_storage/cloud_transformations/variant.rb +5 -2
- data/lib/active_storage/cloud_transformations/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: 0ca4a766a27a3db03e238b9ff7f64a58ee5bacf55bab9bff4ea03b09afd3dfc8
|
4
|
+
data.tar.gz: ead7756628869463b88452f4938c9651e8f9a30cd67596e7dcfcfdfce6eace8f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f66255e8de41282a371c8dae1af1c3d1b1158578c978930d061509fb1d66da4884e3abef28ce84c5c881ec84dad1897de9532d832c6ce3e3436280b6418bffad
|
7
|
+
data.tar.gz: 9c3eccb6e674d346bd69a4ea4d4d4b6e8d37be89511ca431ad1765f938d2a291f494c08f3fa3661b7481aaae4c80ddf6d4115fdeb7cf415622c72410347dd6a6
|
@@ -22,7 +22,7 @@ module ActiveStorage
|
|
22
22
|
private
|
23
23
|
|
24
24
|
def create_blob_preview_image_and_blob_preview_image_variant
|
25
|
-
preview_image_blob = ActiveStorage::Blob.create_before_direct_upload!({
|
25
|
+
preview_image_blob = ActiveStorage::Blob.create_before_direct_upload!(**{
|
26
26
|
filename: "#{blob.filename.base}.#{variation.format}",
|
27
27
|
content_type: variation.content_type,
|
28
28
|
service_name: blob.service_name,
|
@@ -33,7 +33,7 @@ module ActiveStorage
|
|
33
33
|
|
34
34
|
variant_variation = variation.default_to(preview_image_blob.send(:default_variant_transformations))
|
35
35
|
variant_record = blob.preview_image.variant_records.create!(variation_digest: variant_variation.digest)
|
36
|
-
variant_blob = ActiveStorage::Blob.create_before_direct_upload!({
|
36
|
+
variant_blob = ActiveStorage::Blob.create_before_direct_upload!(**{
|
37
37
|
filename: "#{blob.filename.base}.#{variant_variation.format}",
|
38
38
|
content_type: variant_variation.content_type,
|
39
39
|
service_name: blob.service_name,
|
@@ -6,10 +6,11 @@ module ActiveStorage
|
|
6
6
|
def process
|
7
7
|
raise ActiveStorage::InvariableError unless blob.image? || blob.video?
|
8
8
|
|
9
|
-
ActiveRecord
|
9
|
+
role = ActiveRecord.respond_to?(:writing_role) ? ActiveRecord.writing_role : ActiveRecord::Base.writing_role
|
10
|
+
ActiveRecord::Base.connected_to(role: role) do
|
10
11
|
# FIXME #create_or_find_by! runs the block in both cases. bug in rails?
|
11
12
|
blob.variant_records.find_or_create_by!(variation_digest: variation.digest) do |record|
|
12
|
-
output_blob = ActiveStorage::Blob.create_before_direct_upload!({
|
13
|
+
output_blob = ActiveStorage::Blob.create_before_direct_upload!(**{
|
13
14
|
filename: "#{blob.filename.base}.#{variation.format}",
|
14
15
|
content_type: variation.content_type,
|
15
16
|
service_name: blob.service_name,
|
@@ -31,6 +32,8 @@ module ActiveStorage
|
|
31
32
|
run_crucible_job(blob, output_blob, ignore_timeouts: true)
|
32
33
|
end
|
33
34
|
|
35
|
+
public :processed?
|
36
|
+
|
34
37
|
private
|
35
38
|
|
36
39
|
def run_crucible_job input_blob, output_blob, ignore_timeouts: false
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: active_storage-cloud_transformations
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Micah Geisel
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2024-07-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activestorage
|
@@ -73,7 +73,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
73
73
|
- !ruby/object:Gem::Version
|
74
74
|
version: '0'
|
75
75
|
requirements: []
|
76
|
-
rubygems_version: 3.
|
76
|
+
rubygems_version: 3.2.32
|
77
77
|
signing_key:
|
78
78
|
specification_version: 4
|
79
79
|
summary: Generate ActiveStorage Variants and Previews via external cloud services,
|