Class: ActiveStorage::CloudTransformations::Preview
- Inherits:
-
Preview
- Object
- Preview
- ActiveStorage::CloudTransformations::Preview
- Includes:
- CrucibleHelpers
- Defined in:
- lib/active_storage/cloud_transformations/preview.rb
Instance Method Summary collapse
Instance Method Details
#process ⇒ Object
5 6 7 8 9 10 11 12 13 14 15 16 17 |
# File 'lib/active_storage/cloud_transformations/preview.rb', line 5 def process # if image.attached? # if image.variant(variation).processed? # variant # else # create_blob_preview_image_variant # end # else if !blob.preview_image.attached? reprocess end self end |
#processed? ⇒ Boolean
19 20 21 |
# File 'lib/active_storage/cloud_transformations/preview.rb', line 19 def processed? image.variant(variation)&.processed? end |
#reprocess ⇒ Object
23 24 25 |
# File 'lib/active_storage/cloud_transformations/preview.rb', line 23 def reprocess create_blob_preview_image_and_blob_preview_image_variant end |