Class: Alchemy::PictureThumb::Create
- Inherits:
-
Object
- Object
- Alchemy::PictureThumb::Create
- Defined in:
- app/models/alchemy/picture_thumb/create.rb
Overview
Stores the render result of a Alchemy::PictureVariant in the configured Dragonfly datastore (Default: Dragonfly::FileDataStore)
Class Method Summary collapse
-
.call(variant, signature, uid) ⇒ Alchemy::PictureThumb
The persisted thumbnail record.
Class Method Details
.call(variant, signature, uid) ⇒ Alchemy::PictureThumb
Returns The persisted thumbnail record.
17 18 19 20 21 22 23 24 25 |
# File 'app/models/alchemy/picture_thumb/create.rb', line 17 def call(variant, signature, uid) image = variant.image image.to_file(server_path(uid)).close variant.picture.thumbs.create!( picture: variant.picture, signature: signature, uid: uid, ) end |