active_storage-cloud_transformations 0.2.0 → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- 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 +3 -2
- data/lib/active_storage/cloud_transformations/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: 1a286939cfe2d2d95bfe2b467738184670cc41783650e4c477e5e820ae48c128
|
4
|
+
data.tar.gz: 48c8773651366e73b47a25b51e29c72252c04cc33e0e3b23e70b87130e0b931a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bd3801033c078a674ca3264e048523e046c403981c8b73129ff70e7d2eb4dd3830aac9e6c8a601db1df1c85e8c9f6ac9647595577659a338965a635587da7996
|
7
|
+
data.tar.gz: 683f154242fb9390fdf36adaa4875f4e17ff07235cf4d157d49cb1c9ef278dbe8518dc5fdc3cf9545ae2cdbaba718de119aa57858d7cf552aad8737764e25921
|
@@ -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,
|
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.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Micah Geisel
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-06-
|
11
|
+
date: 2022-06-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activestorage
|