—
title: Shrine
2.3.0¶ ↑
New plugins¶ ↑
-
The
copy
plugin has been added for copying files from one record to another. Duplicating the model instance will automatically create a copy of the attachment.
Shrine.plugin :copy
photo = Photo.find(photo_id) duplicated_photo = photo.dup # duplicates the attachment photo.image != duplicated_photo.image
photo.image_attacher.copy(other_photo.image_attacher)
New Features¶ ↑
-
The
:directory_permissions
option has been added toStorage::FileSystem
for specifying UNIX permissions of all directories inside the main directory.
Other improvements¶ ↑
-
Directory permissions are now applied to aoll subdirectories inside the main directory
-
The default UNIX permissions are now 0644 for files and 0755 for directories. Previously it relied on defaults of the operating system.
-
The
backgrounding
plugin doesn’t require the model instance to have the#id=
writer method anymore. -
The
Attacher#read
method for returning the value of the underlying column is now public. -
The
Attacher#context
can now be mutated for an instantiated Attacher object. -
Fixed
Attacher#swap
method being private after loadingsequel
oractiverecord
plugin. -
The
recache
plugin behaviour has been extracted intoAttacher#recache
, so that it can be used standalone. -
The
moving
plugin now works correctly withbackup
plugin. -
The
direct_upload
plugin now prevents the client from caching the presign response, by returningCache-Control: no-store
header.