shrine 3.0.0.rc → 3.0.0

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of shrine might be problematic. Click here for more details.

Files changed (167) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +10 -66
  3. data/README.md +39 -1061
  4. data/doc/advantages.md +151 -148
  5. data/doc/attacher.md +12 -30
  6. data/doc/carrierwave.md +150 -115
  7. data/doc/changing_derivatives.md +5 -11
  8. data/doc/changing_location.md +8 -5
  9. data/doc/changing_storage.md +5 -2
  10. data/doc/creating_persistence_plugins.md +9 -6
  11. data/doc/creating_plugins.md +42 -22
  12. data/doc/creating_storages.md +4 -1
  13. data/doc/design.md +7 -5
  14. data/doc/direct_s3.md +9 -4
  15. data/doc/external/articles.md +50 -0
  16. data/doc/external/extensions.md +46 -0
  17. data/doc/external/misc.md +17 -0
  18. data/doc/getting_started.md +1038 -0
  19. data/doc/metadata.md +5 -3
  20. data/doc/multiple_files.md +55 -29
  21. data/doc/paperclip.md +206 -163
  22. data/doc/plugins/activerecord.md +26 -6
  23. data/doc/plugins/add_metadata.md +4 -2
  24. data/doc/plugins/atomic_helpers.md +4 -2
  25. data/doc/plugins/backgrounding.md +83 -44
  26. data/doc/plugins/cached_attachment_data.md +4 -2
  27. data/doc/plugins/column.md +4 -2
  28. data/doc/plugins/data_uri.md +10 -6
  29. data/doc/plugins/default_storage.md +5 -3
  30. data/doc/plugins/default_url.md +4 -2
  31. data/doc/plugins/delete_raw.md +4 -2
  32. data/doc/plugins/derivation_endpoint.md +63 -39
  33. data/doc/plugins/derivatives.md +13 -50
  34. data/doc/plugins/determine_mime_type.md +6 -4
  35. data/doc/plugins/download_endpoint.md +6 -3
  36. data/doc/plugins/dynamic_storage.md +4 -2
  37. data/doc/plugins/entity.md +6 -4
  38. data/doc/plugins/form_assign.md +4 -2
  39. data/doc/plugins/included.md +4 -2
  40. data/doc/plugins/infer_extension.md +6 -4
  41. data/doc/plugins/instrumentation.md +5 -3
  42. data/doc/plugins/keep_files.md +9 -2
  43. data/doc/plugins/metadata_attributes.md +5 -3
  44. data/doc/plugins/mirroring.md +4 -2
  45. data/doc/plugins/model.md +6 -4
  46. data/doc/plugins/module_include.md +4 -2
  47. data/doc/plugins/multi_cache.md +4 -2
  48. data/doc/plugins/persistence.md +5 -3
  49. data/doc/plugins/presign_endpoint.md +6 -2
  50. data/doc/plugins/pretty_location.md +5 -3
  51. data/doc/plugins/processing.md +4 -2
  52. data/doc/plugins/rack_file.md +8 -2
  53. data/doc/plugins/rack_response.md +6 -2
  54. data/doc/plugins/recache.md +4 -2
  55. data/doc/plugins/refresh_metadata.md +5 -3
  56. data/doc/plugins/remote_url.md +26 -5
  57. data/doc/plugins/remove_attachment.md +4 -2
  58. data/doc/plugins/remove_invalid.md +10 -2
  59. data/doc/plugins/restore_cached_data.md +9 -3
  60. data/doc/plugins/sequel.md +26 -6
  61. data/doc/plugins/signature.md +6 -4
  62. data/doc/plugins/store_dimensions.md +6 -4
  63. data/doc/plugins/tempfile.md +4 -2
  64. data/doc/plugins/upload_endpoint.md +6 -2
  65. data/doc/plugins/upload_options.md +6 -4
  66. data/doc/plugins/url_options.md +4 -2
  67. data/doc/plugins/validation.md +7 -3
  68. data/doc/plugins/validation_helpers.md +13 -10
  69. data/doc/plugins/versions.md +4 -8
  70. data/doc/processing.md +27 -9
  71. data/doc/refile.md +119 -127
  72. data/doc/release_notes/1.0.0.md +4 -0
  73. data/doc/release_notes/1.1.0.md +4 -0
  74. data/doc/release_notes/1.2.0.md +4 -0
  75. data/doc/release_notes/1.3.0.md +4 -0
  76. data/doc/release_notes/1.4.0.md +4 -0
  77. data/doc/release_notes/1.4.1.md +4 -0
  78. data/doc/release_notes/1.4.2.md +4 -0
  79. data/doc/release_notes/2.0.0.md +4 -0
  80. data/doc/release_notes/2.0.1.md +4 -0
  81. data/doc/release_notes/2.1.0.md +4 -0
  82. data/doc/release_notes/2.1.1.md +4 -0
  83. data/doc/release_notes/2.10.0.md +4 -0
  84. data/doc/release_notes/2.10.1.md +4 -0
  85. data/doc/release_notes/2.11.0.md +4 -0
  86. data/doc/release_notes/2.12.0.md +4 -0
  87. data/doc/release_notes/2.13.0.md +4 -0
  88. data/doc/release_notes/2.14.0.md +5 -1
  89. data/doc/release_notes/2.15.0.md +10 -6
  90. data/doc/release_notes/2.16.0.md +4 -0
  91. data/doc/release_notes/2.17.0.md +4 -0
  92. data/doc/release_notes/2.18.0.md +4 -0
  93. data/doc/release_notes/2.19.0.md +7 -4
  94. data/doc/release_notes/2.2.0.md +4 -0
  95. data/doc/release_notes/2.3.0.md +4 -0
  96. data/doc/release_notes/2.3.1.md +4 -0
  97. data/doc/release_notes/2.4.0.md +4 -0
  98. data/doc/release_notes/2.4.1.md +4 -0
  99. data/doc/release_notes/2.5.0.md +4 -0
  100. data/doc/release_notes/2.6.0.md +4 -0
  101. data/doc/release_notes/2.6.1.md +4 -0
  102. data/doc/release_notes/2.7.0.md +4 -0
  103. data/doc/release_notes/2.8.0.md +4 -0
  104. data/doc/release_notes/2.9.0.md +4 -0
  105. data/doc/release_notes/3.0.0.md +120 -38
  106. data/doc/retrieving_uploads.md +4 -1
  107. data/doc/securing_uploads.md +4 -1
  108. data/doc/storage/file_system.md +12 -4
  109. data/doc/storage/s3.md +4 -2
  110. data/doc/testing.md +27 -41
  111. data/doc/upgrading_to_3.md +105 -26
  112. data/doc/validation.md +8 -6
  113. data/lib/shrine/attacher.rb +2 -2
  114. data/lib/shrine/attachment.rb +7 -10
  115. data/lib/shrine/plugins/activerecord.rb +10 -10
  116. data/lib/shrine/plugins/add_metadata.rb +1 -3
  117. data/lib/shrine/plugins/atomic_helpers.rb +6 -8
  118. data/lib/shrine/plugins/backgrounding.rb +4 -6
  119. data/lib/shrine/plugins/cached_attachment_data.rb +1 -3
  120. data/lib/shrine/plugins/column.rb +2 -4
  121. data/lib/shrine/plugins/data_uri.rb +1 -3
  122. data/lib/shrine/plugins/default_storage.rb +1 -3
  123. data/lib/shrine/plugins/default_url.rb +1 -3
  124. data/lib/shrine/plugins/delete_raw.rb +1 -3
  125. data/lib/shrine/plugins/derivation_endpoint.rb +3 -4
  126. data/lib/shrine/plugins/derivatives.rb +2 -4
  127. data/lib/shrine/plugins/determine_mime_type.rb +1 -3
  128. data/lib/shrine/plugins/download_endpoint.rb +1 -3
  129. data/lib/shrine/plugins/dynamic_storage.rb +1 -3
  130. data/lib/shrine/plugins/entity.rb +25 -9
  131. data/lib/shrine/plugins/form_assign.rb +1 -3
  132. data/lib/shrine/plugins/included.rb +1 -3
  133. data/lib/shrine/plugins/infer_extension.rb +1 -3
  134. data/lib/shrine/plugins/instrumentation.rb +1 -3
  135. data/lib/shrine/plugins/keep_files.rb +1 -3
  136. data/lib/shrine/plugins/metadata_attributes.rb +1 -3
  137. data/lib/shrine/plugins/mirroring.rb +2 -1
  138. data/lib/shrine/plugins/model.rb +2 -4
  139. data/lib/shrine/plugins/module_include.rb +1 -3
  140. data/lib/shrine/plugins/multi_cache.rb +3 -3
  141. data/lib/shrine/plugins/presign_endpoint.rb +1 -3
  142. data/lib/shrine/plugins/pretty_location.rb +1 -3
  143. data/lib/shrine/plugins/processing.rb +1 -3
  144. data/lib/shrine/plugins/rack_file.rb +1 -3
  145. data/lib/shrine/plugins/rack_response.rb +1 -3
  146. data/lib/shrine/plugins/recache.rb +1 -3
  147. data/lib/shrine/plugins/refresh_metadata.rb +1 -3
  148. data/lib/shrine/plugins/remote_url.rb +1 -3
  149. data/lib/shrine/plugins/remove_attachment.rb +1 -3
  150. data/lib/shrine/plugins/remove_invalid.rb +1 -3
  151. data/lib/shrine/plugins/restore_cached_data.rb +1 -3
  152. data/lib/shrine/plugins/sequel.rb +10 -12
  153. data/lib/shrine/plugins/signature.rb +1 -3
  154. data/lib/shrine/plugins/store_dimensions.rb +1 -3
  155. data/lib/shrine/plugins/tempfile.rb +1 -3
  156. data/lib/shrine/plugins/upload_endpoint.rb +1 -3
  157. data/lib/shrine/plugins/upload_options.rb +1 -3
  158. data/lib/shrine/plugins/url_options.rb +1 -3
  159. data/lib/shrine/plugins/validation.rb +1 -3
  160. data/lib/shrine/plugins/validation_helpers.rb +1 -3
  161. data/lib/shrine/plugins/versions.rb +1 -3
  162. data/lib/shrine/storage/file_system.rb +1 -1
  163. data/lib/shrine/storage/linter.rb +1 -1
  164. data/lib/shrine/storage/memory.rb +2 -1
  165. data/lib/shrine/storage/s3.rb +3 -3
  166. data/lib/shrine/version.rb +1 -1
  167. metadata +8 -4
@@ -1,3 +1,7 @@
1
+ ---
2
+ title: Shrine 1.0.0
3
+ ---
4
+
1
5
  # Backwards compatibility
2
6
 
3
7
  * The `delete_invalid` plugin was removed, because it was unstable since next
@@ -1,3 +1,7 @@
1
+ ---
2
+ title: Shrine 1.1.0
3
+ ---
4
+
1
5
  # New plugins
2
6
 
3
7
  * The `download_endpoint` plugin has been added, which allows downloading files
@@ -1,3 +1,7 @@
1
+ ---
2
+ title: Shrine 1.2.0
3
+ ---
4
+
1
5
  New features
2
6
  ============
3
7
 
@@ -1,3 +1,7 @@
1
+ ---
2
+ title: Shrine 1.3.0
3
+ ---
4
+
1
5
  New features
2
6
  ============
3
7
 
@@ -1,3 +1,7 @@
1
+ ---
2
+ title: Shrine 1.4.0
3
+ ---
4
+
1
5
  New features
2
6
  ============
3
7
 
@@ -1,3 +1,7 @@
1
+ ---
2
+ title: Shrine 1.4.1
3
+ ---
4
+
1
5
  Regressions
2
6
  ===========
3
7
 
@@ -1,3 +1,7 @@
1
+ ---
2
+ title: Shrine 1.4.2
3
+ ---
4
+
1
5
  Regressions
2
6
  ===========
3
7
 
@@ -1,3 +1,7 @@
1
+ ---
2
+ title: Shrine 2.0.0
3
+ ---
4
+
1
5
  Backwards compatibility
2
6
  =======================
3
7
 
@@ -1,3 +1,7 @@
1
+ ---
2
+ title: Shrine 2.0.1
3
+ ---
4
+
1
5
  Regressions
2
6
  ===========
3
7
 
@@ -1,3 +1,7 @@
1
+ ---
2
+ title: Shrine 2.1.0
3
+ ---
4
+
1
5
  Improvements
2
6
  ============
3
7
 
@@ -1,3 +1,7 @@
1
+ ---
2
+ title: Shrine 2.1.1
3
+ ---
4
+
1
5
  Regressions
2
6
  ===========
3
7
 
@@ -1,3 +1,7 @@
1
+ ---
2
+ title: Shrine 2.10.0
3
+ ---
4
+
1
5
  ## New features
2
6
 
3
7
  * The `:mini_magick` analyzer has been added to the `store_dimensions` plugin,
@@ -1,3 +1,7 @@
1
+ ---
2
+ title: Shrine 2.10.1
3
+ ---
4
+
1
5
  ## Regressions
2
6
 
3
7
  * Determining MIME type from file extension (using `:mime_types` or
@@ -1,3 +1,7 @@
1
+ ---
2
+ title: Shrine 2.11.0
3
+ ---
4
+
1
5
  ## New features
2
6
 
3
7
  * `Shrine::UploadedFile#stream` has been added for streaming the uploaded
@@ -1,3 +1,7 @@
1
+ ---
2
+ title: Shrine 2.12.0
3
+ ---
4
+
1
5
  ## New features
2
6
 
3
7
  * The `Shrine::Attacher#assign_remote_url` method has been added, which acts the
@@ -1,3 +1,7 @@
1
+ ---
2
+ title: Shrine 2.13.0
3
+ ---
4
+
1
5
  ## New features
2
6
 
3
7
  * The S3 object URLs can now be signed with a custom signer. This enables
@@ -1,3 +1,7 @@
1
+ ---
2
+ title: Shrine 2.14.0
3
+ ---
4
+
1
5
  ## New features
2
6
 
3
7
  * `Shrine::Storage::S3` now accepts a `:client` option for specifying an AWS
@@ -274,5 +278,5 @@
274
278
  `#download_url`). If you've are currently overriding any of these private
275
279
  methods, you'll need to update your code.
276
280
 
277
- [Retrieving Uploads]: /doc/retrieving_uploads.md#readme
281
+ [Retrieving Uploads]: https://shrinerb.com/docs/retrieving-uploads
278
282
  [content_disposition]: https://github.com/shrinerb/content_disposition
@@ -1,3 +1,7 @@
1
+ ---
2
+ title: Shrine 2.15.0
3
+ ---
4
+
1
5
  ## New features
2
6
 
3
7
  * The [`derivation_endpoint`][derivation_endpoint] plugin has been added, which
@@ -74,9 +78,9 @@
74
78
  relying on multiple invocations returning the same object, you will need to
75
79
  modify your code.
76
80
 
77
- [derivation_endpoint]: /doc/plugins/derivation_endpoint.md#readme
78
- [CDN host]: /doc/plugins/derivation_endpoint.md#host
79
- [`Content-Type`]: /doc/plugins/derivation_endpoint.md#content-type
80
- [`Content-Disposition`]: /doc/plugins/derivation_endpoint.md#content-disposition
81
- [URL expiration]: /doc/plugins/derivation_endpoint.md#expiration
82
- [uploading]: /doc/plugins/derivation_endpoint.md#uploading
81
+ [derivation_endpoint]: https://shrinerb.com/docs/plugins/derivation_endpoint
82
+ [CDN host]: https://shrinerb.com/docs/plugins/derivation_endpoint#host
83
+ [`Content-Type`]: https://shrinerb.com/docs/plugins/derivation_endpoint#content-type
84
+ [`Content-Disposition`]: https://shrinerb.com/docs/plugins/derivation_endpoint#content-disposition
85
+ [URL expiration]: https://shrinerb.com/docs/plugins/derivation_endpoint#expiration
86
+ [uploading]: https://shrinerb.com/docs/plugins/derivation_endpoint#uploading
@@ -1,3 +1,7 @@
1
+ ---
2
+ title: Shrine 2.16.0
3
+ ---
4
+
1
5
  ## New Features
2
6
 
3
7
  * The `:download_options` option has been added to the `download_endpoint`
@@ -1,3 +1,7 @@
1
+ ---
2
+ title: Shrine 2.17.0
3
+ ---
4
+
1
5
  ## New features
2
6
 
3
7
  * The `download_endpoint` plugin now accepts ad-hoc options when creating the
@@ -1,3 +1,7 @@
1
+ ---
2
+ title: Shrine 2.18.0
3
+ ---
4
+
1
5
  ## New features
2
6
 
3
7
  * Added `Shrine.upload_response` to `upload_endpoint` plugin for handling
@@ -1,3 +1,7 @@
1
+ ---
2
+ title: Shrine 2.19.0
3
+ ---
4
+
1
5
  ## New features
2
6
 
3
7
  * A new `instrumentation` plugin has been added. It sends and logs events for
@@ -12,7 +16,7 @@
12
16
  uploaded_file.download
13
17
  uploaded_file.delete
14
18
  ```
15
- ```
19
+ ```plaintext
16
20
  Metadata (32ms) – {:storage=>:store, :io=>StringIO, :uploader=>Shrine}
17
21
  Upload (1523ms) – {:storage=>:store, :location=>"ed0e30ddec8b97813f2c1f4cfd1700b4", :io=>StringIO, :upload_options=>{}, :uploader=>Shrine}
18
22
  Exists (755ms) – {:storage=>:store, :location=>"ed0e30ddec8b97813f2c1f4cfd1700b4", :uploader=>Shrine}
@@ -228,8 +232,8 @@
228
232
  `FileSystem#upload`. This means that the `#move` && `#movable?` methods are
229
233
  not part of the storage abstraction anymore.
230
234
 
231
- * The `backup` plugin has been deprecated over [mirroring uploads] via the
232
- `instrumentation` plugin.
235
+ * The `backup` plugin has been deprecated (a new `mirroring` plugin will get
236
+ added in 3.0).
233
237
 
234
238
  * The `copy` plugin has been deprecated.
235
239
 
@@ -260,4 +264,3 @@
260
264
 
261
265
  [ActiveSupport::Notifications]: https://api.rubyonrails.org/classes/ActiveSupport/Notifications.html
262
266
  [dry-monitor]: https://github.com/dry-rb/dry-monitor
263
- [mirroring uploads]: https://github.com/shrinerb/shrine/wiki/Mirroring-Uploads
@@ -1,3 +1,7 @@
1
+ ---
2
+ title: Shrine 2.2.0
3
+ ---
4
+
1
5
  ## New plugins
2
6
 
3
7
  * The processing plugin has been added for declaratively defining processing
@@ -1,3 +1,7 @@
1
+ ---
2
+ title: Shrine 2.3.0
3
+ ---
4
+
1
5
  ## New plugins
2
6
 
3
7
  * The `copy` plugin has been added for copying files from one record to
@@ -1,3 +1,7 @@
1
+ ---
2
+ title: Shrine 2.3.1
3
+ ---
4
+
1
5
  Regressions
2
6
  ===========
3
7
 
@@ -1,3 +1,7 @@
1
+ ---
2
+ title: Shrine 2.4.0
3
+ ---
4
+
1
5
  ## New features
2
6
 
3
7
  * The `default_url_options` plugin accepts a block for dynamically generating
@@ -1,3 +1,7 @@
1
+ ---
2
+ title: Shrine 2.4.1
3
+ ---
4
+
1
5
  ## Regressions
2
6
 
3
7
  * Prior to version 2.4.0, the conversion of uploaded file data to JSON was
@@ -1,3 +1,7 @@
1
+ ---
2
+ title: Shrine 2.5.0
3
+ ---
4
+
1
5
  ## New features
2
6
 
3
7
  * The `add_metadata` plugin has been extended to enable extracting and saving
@@ -1,3 +1,7 @@
1
+ ---
2
+ title: Shrine 2.6.0
3
+ ---
4
+
1
5
  ## New plugins
2
6
 
3
7
  * Added `signature` plugin which allows you to calculate a
@@ -1,3 +1,7 @@
1
+ ---
2
+ title: Shrine 2.6.1
3
+ ---
4
+
1
5
  ## Bug fixes
2
6
 
3
7
  * When `download_endpoint` streams file content into the response body, with
@@ -1,3 +1,7 @@
1
+ ---
2
+ title: Shrine 2.7.0
3
+ ---
4
+
1
5
  ## New Plugins
2
6
 
3
7
  * The `direct_upload` plugin has been split into `upload_endpoint` and
@@ -1,3 +1,7 @@
1
+ ---
2
+ title: Shrine 2.9.0
3
+ ---
4
+
1
5
  ## New Features
2
6
 
3
7
  * The `rack_response` plugin now supports [range requests] via the `:range`
@@ -1,3 +1,7 @@
1
+ ---
2
+ title: Shrine 2.9.0
3
+ ---
4
+
1
5
  ## New Plugins
2
6
 
3
7
  * The `infer_extension` plugin has been added, which automatically infers
@@ -1,4 +1,6 @@
1
- # Shrine 3.0.0
1
+ ---
2
+ title: Shrine 3.0.0
3
+ ---
2
4
 
3
5
  This guide covers all the changes in the 3.0.0 version of Shrine. If you're
4
6
  currently using Shrine 2.x, see [Upgrading to Shrine 3.x] for instructions on
@@ -35,9 +37,82 @@ how to upgrade.
35
37
  improvements:
36
38
 
37
39
  - processed files are separated from the main file
40
+
41
+ ```rb
42
+ photo.image_data #=>
43
+ # {
44
+ # "id": "original.jpg",
45
+ # "storage": "store",
46
+ # "metadata": { ... },
47
+ # "derivatives": {
48
+ # "large": { "id": "large.jpg", "storage": "store", "metadata": { ... } },
49
+ # "medium": { "id": "medium.jpg", "storage": "store", "metadata": { ... } },
50
+ # "small": { "id": "small.jpg", "storage": "store", "metadata": { ... } }
51
+ # }
52
+ # }
53
+
54
+ photo.image #=> #<Shrine::UploadedFile @id="original.jpg" ...>
55
+ photo.image_derivatives #=>
56
+ # {
57
+ # large: #<Shrine::UploadedFile @id="large.jpg" ...>,
58
+ # medium: #<Shrine::UploadedFile @id="medium.jpg" ...>,
59
+ # small: #<Shrine::UploadedFile @id="small.jpg" ...>,
60
+ # }
61
+ ```
62
+
38
63
  - processing is decoupled from promotion
64
+
65
+ ```rb
66
+ photo = Photo.create(image: file) # promote original file to permanent storage
67
+ photo.image_derivatives! # generate derivatives after promotion
68
+ photo.save # save derivatives data
69
+ ```
70
+
39
71
  - ability to add or remove processed files at any point
40
- - possibility of storing processed files on a separate storage
72
+
73
+ ```rb
74
+ class ImageUploader < Shrine
75
+ Attacher.derivatives_processor :thumbnails do |original|
76
+ # ...
77
+ end
78
+
79
+ Attacher.derivatives_processor :crop do |original, left:, top:, width:, height:|
80
+ vips = ImageProcessing::Vips.source(original)
81
+
82
+ { cropped: vips.crop!(left, top, width, height) }
83
+ end
84
+ end
85
+ ```
86
+ ```rb
87
+ photo.image_derivatives!(:thumbnails)
88
+ photo.image_derivatives #=> { large: ..., medium: ..., small: ... }
89
+ photo.save
90
+
91
+ # ... sometime later ...
92
+
93
+ photo.image_derivatives!(:crop, left: 0, top: 0, width: 300, height: 300)
94
+ photo.image_derivatives #=> { large: ..., medium: ..., small: ..., cropped: ... }
95
+ photo.save
96
+ ```
97
+
98
+ - possibility of uploading processed files to different storage
99
+
100
+ ```rb
101
+ class ImageUploader < Shrine
102
+ # specify storage for all derivatives
103
+ Attacher.derivatives_storage :other_store
104
+
105
+ # or specify storage per derivative
106
+ Attacher.derivatives_storage { |derivative| :other_store }
107
+ end
108
+ ```
109
+ ```rb
110
+ photo = Photo.create(image: file)
111
+ photo.image.storage_key #=> :store
112
+
113
+ photo.image_derivatives!
114
+ photo.image_derivatives[:large].storage_key #=> :other_store
115
+ ```
41
116
 
42
117
  * The [`Shrine::Attacher`][attacher] class has been rewritten and can now be
43
118
  used without models:
@@ -113,7 +188,7 @@ how to upgrade.
113
188
  ```
114
189
 
115
190
  * The new [`model`][model] plugin adds support for mutable structs, which is
116
- used for `activerecord` and `sequel` plugins.
191
+ used by `activerecord` and `sequel` plugins.
117
192
 
118
193
  ```rb
119
194
  Shrine.plugin :model
@@ -281,6 +356,8 @@ how to upgrade.
281
356
  attacher.file #=> #<Shrine::UploadedFile @id="..." @storage_key=:cache ...>
282
357
  ```
283
358
 
359
+ ## Other features
360
+
284
361
  * Model file assignment can now be configured to upload directly to permanent
285
362
  storage.
286
363
 
@@ -292,8 +369,6 @@ how to upgrade.
292
369
  photo.image.storage_key #=> :store (permanent storage)
293
370
  ```
294
371
 
295
- ## Other features
296
-
297
372
  * New `Shrine.download_response` method has been added to the
298
373
  `download_endpoint` plugin for generating file response from the controller.
299
374
 
@@ -383,6 +458,13 @@ how to upgrade.
383
458
  * New `Derivation#opened` method has been added for retrieving an opened
384
459
  derivative in `derivation_endpoint` plugin.
385
460
 
461
+ * New `Storage#delete_prefixed` method has been added for deleting all files
462
+ in specified directory.
463
+
464
+ ```rb
465
+ storage.delete_prefixed("some_directory/")
466
+ ```
467
+
386
468
  ## Performance improvements
387
469
 
388
470
  * The attached file is now parsed and loaded from record column only once,
@@ -454,6 +536,15 @@ how to upgrade.
454
536
 
455
537
  * The `down` dependency has been updated to `~> 5.0`.
456
538
 
539
+ * The `Shrine::Attachment[]` method has been added as an alternative syntax for
540
+ creating attachment modules.
541
+
542
+ ```rb
543
+ class Photo
544
+ include ImageUploader::Attachment[:image]
545
+ end
546
+ ```
547
+
457
548
  ### Plugin improvements
458
549
 
459
550
  * The `activerecord` plugin now works with Active Record 3.
@@ -461,6 +552,10 @@ how to upgrade.
461
552
  * Callback code from `activerecord` and `sequel` plugin has been moved into
462
553
  attacher methods, allowing the user to override them.
463
554
 
555
+ - `Attacher#(activerecord|sequel)_before_save`
556
+ - `Attacher#(activerecord|sequel)_after_save`
557
+ - `Attacher#(activerecord|sequel)_after_destroy`
558
+
464
559
  * The `url_options` plugin now allows you to override URL options by deleting
465
560
  them.
466
561
 
@@ -534,6 +629,9 @@ how to upgrade.
534
629
  # "blog_post/aa357797-5845-451b-8662-08eecdc9f762/image/493g82jf23.jpg"
535
630
  ```
536
631
 
632
+ * You can now load multiple persistence plugins simulatenously, and the correct
633
+ one will be activated during persistence.
634
+
537
635
  ## Backwards compatibility
538
636
 
539
637
  ### Plugin deprecation and removal
@@ -559,25 +657,11 @@ how to upgrade.
559
657
 
560
658
  ### Attacher API
561
659
 
562
- * The `Attacher.new` method now only accepts a hash of options.
563
-
564
- ```rb
565
- # this doesn't work anymore
566
- Shrine::Attacher.new(photo, :image) # ~> ArgumentError: invalid number of arguments
567
-
568
- # this should be used instead
569
- Shrine::Attacher.from_model(photo, :image)
570
- ```
571
-
572
- * The attacher won't detect direct data attribute changes anymore. If you're
573
- updating the data attribute and are expecting to see the change applied to
574
- the attacher, you'll need to call `Attacher#reload`.
660
+ * The `Attacher.new` method now only accepts a hash of options, use
661
+ `Attacher.from_model` for initializing from a model.
575
662
 
576
- ```rb
577
- attacher = photo.image_attacher
578
- photo.image_data = '...'
579
- attacher.reload
580
- ```
663
+ * If you're changing the attachment data column directly, you'll now need to
664
+ call `Attacher#reload` to make the attacher reflect those changes.
581
665
 
582
666
  * The `Attacher#promote` method now only saves the promoted file in memory,
583
667
  it doesn't persist the changes.
@@ -768,9 +852,6 @@ how to upgrade.
768
852
 
769
853
  - The `Derivation#upload` method now closes the uploaded file.
770
854
 
771
- - Uploader deleting the uploaded derivative isn't supported anymore (e.g.
772
- `delete_raw` plugin).
773
-
774
855
  - The `derivation.upload` instrumentation event payload now includes only
775
856
  `:derivation` key.
776
857
 
@@ -867,16 +948,17 @@ how to upgrade.
867
948
 
868
949
  - The `:callbacks` plugin option has been renamed to `:hooks`.
869
950
 
870
- [derivatives]: /doc/plugins/derivatives.md#readme
871
- [versions]: /doc/plugins/versions.md#readme
872
- [backgrounding]: /doc/plugins/backgrounding.md#readme
951
+ [derivatives]: https://shrinerb.com/docs/plugins/derivatives
952
+ [versions]: https://shrinerb.com/docs/plugins/versions
953
+ [backgrounding]: https://shrinerb.com/docs/plugins/backgrounding
873
954
  [shrine-memory]: https://github.com/shrinerb/shrine-memory
874
- [atomic_helpers]: /doc/plugins/atomic_helpers.md#readme
875
- [attacher]: /doc/attacher.md#readme
876
- [column]: /doc/plugins/column.md#readme
877
- [entity]: /doc/plugins/entity.md#readme
878
- [model]: /doc/plugins/model.md#readme
879
- [persistence]: /doc/plugins/persistence.md#readme
880
- [mirroring]: /doc/plugins/mirroring.md#readme
881
- [form_assign]: /doc/plugins/form_assign.md#readme
882
- [Upgrading to Shrine 3.x]: /doc/upgrading_to_3.md#readme
955
+ [atomic_helpers]: https://shrinerb.com/docs/plugins/atomic_helpers
956
+ [attacher]: https://shrinerb.com/docs/attacher
957
+ [column]: https://shrinerb.com/docs/plugins/column
958
+ [entity]: https://shrinerb.com/docs/plugins/entity
959
+ [model]: https://shrinerb.com/docs/plugins/model
960
+ [persistence]: https://shrinerb.com/docs/plugins/persistence
961
+ [mirroring]: https://shrinerb.com/docs/plugins/mirroring
962
+ [form_assign]: https://shrinerb.com/docs/plugins/form_assign
963
+ [multi_cache]: https://shrinerb.com/docs/plugins/multi_cache
964
+ [Upgrading to Shrine 3.x]: https://shrinerb.com/docs/upgrading-to-3