activestorage 7.0.8.4 → 7.1.3.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +190 -288
- data/MIT-LICENSE +1 -1
- data/README.md +6 -6
- data/app/assets/javascripts/activestorage.esm.js +11 -7
- data/app/assets/javascripts/activestorage.js +12 -6
- data/app/controllers/active_storage/disk_controller.rb +4 -2
- data/app/controllers/active_storage/representations/proxy_controller.rb +1 -1
- data/app/controllers/concerns/active_storage/file_server.rb +4 -1
- data/app/javascript/activestorage/blob_record.js +4 -1
- data/app/javascript/activestorage/direct_upload.js +3 -2
- data/app/javascript/activestorage/index.js +3 -1
- data/app/javascript/activestorage/ujs.js +3 -3
- data/app/jobs/active_storage/analyze_job.rb +1 -1
- data/app/jobs/active_storage/mirror_job.rb +1 -1
- data/app/jobs/active_storage/purge_job.rb +1 -1
- data/app/jobs/active_storage/transform_job.rb +12 -0
- data/app/models/active_storage/attachment.rb +90 -15
- data/app/models/active_storage/blob/analyzable.rb +4 -3
- data/app/models/active_storage/blob/identifiable.rb +1 -0
- data/app/models/active_storage/blob/representable.rb +7 -3
- data/app/models/active_storage/blob/servable.rb +22 -0
- data/app/models/active_storage/blob.rb +31 -67
- data/app/models/active_storage/current.rb +0 -10
- data/app/models/active_storage/filename.rb +2 -0
- data/app/models/active_storage/named_variant.rb +21 -0
- data/app/models/active_storage/preview.rb +11 -4
- data/app/models/active_storage/variant.rb +10 -7
- data/app/models/active_storage/variant_record.rb +0 -2
- data/app/models/active_storage/variant_with_record.rb +21 -7
- data/app/models/active_storage/variation.rb +5 -3
- data/config/routes.rb +6 -4
- data/db/migrate/20170806125915_create_active_storage_tables.rb +1 -1
- data/lib/active_storage/analyzer/audio_analyzer.rb +16 -4
- data/lib/active_storage/analyzer/image_analyzer.rb +2 -0
- data/lib/active_storage/analyzer/video_analyzer.rb +3 -1
- data/lib/active_storage/analyzer.rb +2 -0
- data/lib/active_storage/attached/changes/create_many.rb +8 -3
- data/lib/active_storage/attached/changes/create_one.rb +45 -3
- data/lib/active_storage/attached/many.rb +5 -4
- data/lib/active_storage/attached/model.rb +72 -43
- data/lib/active_storage/attached/one.rb +5 -4
- data/lib/active_storage/attached.rb +2 -0
- data/lib/active_storage/deprecator.rb +7 -0
- data/lib/active_storage/engine.rb +11 -7
- data/lib/active_storage/fixture_set.rb +7 -1
- data/lib/active_storage/gem_version.rb +3 -3
- data/lib/active_storage/log_subscriber.rb +12 -0
- data/lib/active_storage/previewer.rb +8 -1
- data/lib/active_storage/reflection.rb +3 -3
- data/lib/active_storage/service/azure_storage_service.rb +2 -0
- data/lib/active_storage/service/disk_service.rb +2 -0
- data/lib/active_storage/service/gcs_service.rb +11 -20
- data/lib/active_storage/service/mirror_service.rb +10 -5
- data/lib/active_storage/service/s3_service.rb +2 -0
- data/lib/active_storage/service.rb +4 -2
- data/lib/active_storage/transformers/transformer.rb +2 -0
- data/lib/active_storage/version.rb +1 -1
- data/lib/active_storage.rb +19 -3
- metadata +16 -26
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 10c31beefd192ae50216812e96dd7326c6d301f84f3a9ac4c42cf41369bfbd68
|
4
|
+
data.tar.gz: b744929e6b8cab0e2c2d2f834b453d538fad962a42b6b52f62ed74cf67fd000b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 93dcf40c82c8a7ecb7308c9e90c42a22816876cfe31c42304369a3979b4a6153a6296a8509d60a9e28bccdd0789f299ef3a734cb0b1b46ca1bd1cbd3c5f411ea
|
7
|
+
data.tar.gz: 56d0c210295b80a5bd0fa4145901652ddb3d1baede6a22993a294ae4031a378e99c45775e73caefa8890cf6a5bdafb224c215fc12ca33c20491a0cdf1b201b17
|
data/CHANGELOG.md
CHANGED
@@ -1,429 +1,331 @@
|
|
1
|
-
## Rails 7.
|
1
|
+
## Rails 7.1.3.4 (June 04, 2024) ##
|
2
2
|
|
3
3
|
* No changes.
|
4
4
|
|
5
5
|
|
6
|
-
## Rails 7.
|
6
|
+
## Rails 7.1.3.3 (May 16, 2024) ##
|
7
7
|
|
8
8
|
* No changes.
|
9
9
|
|
10
10
|
|
11
|
-
## Rails 7.
|
11
|
+
## Rails 7.1.3.2 (February 21, 2024) ##
|
12
12
|
|
13
13
|
* No changes.
|
14
14
|
|
15
15
|
|
16
|
-
## Rails 7.
|
17
|
-
|
18
|
-
* Disables the session in `ActiveStorage::Blobs::ProxyController`
|
19
|
-
and `ActiveStorage::Representations::ProxyController`
|
20
|
-
in order to allow caching by default in some CDNs as CloudFlare
|
21
|
-
|
22
|
-
Fixes #44136
|
23
|
-
|
24
|
-
*Bruno Prieto*
|
25
|
-
|
26
|
-
## Rails 7.0.8 (September 09, 2023) ##
|
16
|
+
## Rails 7.1.3.1 (February 21, 2024) ##
|
27
17
|
|
28
18
|
* No changes.
|
29
19
|
|
30
20
|
|
31
|
-
## Rails 7.
|
21
|
+
## Rails 7.1.3 (January 16, 2024) ##
|
32
22
|
|
33
|
-
*
|
23
|
+
* Fix N+1 query when fetching preview images for non-image assets.
|
34
24
|
|
25
|
+
*Aaron Patterson & Justin Searls*
|
35
26
|
|
36
|
-
|
27
|
+
* Fix all Active Storage database related models to respect
|
28
|
+
`ActiveRecord::Base.table_name_prefix` configuration.
|
37
29
|
|
38
|
-
*
|
30
|
+
*Chedli Bourguiba*
|
39
31
|
|
32
|
+
* Fix `ActiveStorage::Representations::ProxyController` not returning the proper
|
33
|
+
preview image variant for previewable files.
|
40
34
|
|
41
|
-
|
42
|
-
|
43
|
-
* No changes.
|
35
|
+
*Chedli Bourguiba*
|
44
36
|
|
37
|
+
* Fix `ActiveStorage::Representations::ProxyController` to proxy untracked
|
38
|
+
variants.
|
45
39
|
|
46
|
-
|
40
|
+
*Chedli Bourguiba*
|
47
41
|
|
48
|
-
* Fix
|
49
|
-
|
50
|
-
In FFmpeg version 5.0+ the rotation value has been removed from tags.
|
51
|
-
Instead the value can be found in side_data_list. Along with
|
52
|
-
this update it's possible to have values of -90, -270 to denote the video
|
53
|
-
has been rotated.
|
42
|
+
* Fix direct upload forms when submit button contains nested elements.
|
54
43
|
|
55
|
-
*
|
44
|
+
*Marc Köhlbrugge*
|
56
45
|
|
46
|
+
* When using the `preprocessed: true` option, avoid enqueuing transform jobs
|
47
|
+
for blobs that are not representable.
|
57
48
|
|
58
|
-
|
49
|
+
*Chedli Bourguiba*
|
59
50
|
|
60
|
-
*
|
51
|
+
* Process preview image variant when calling `ActiveStorage::Preview#processed`.
|
52
|
+
For example, `attached_pdf.preview(:thumb).processed` will now immediately
|
53
|
+
generate the full-sized preview image and the `:thumb` variant of it.
|
54
|
+
Previously, the `:thumb` variant would not be generated until a further call
|
55
|
+
to e.g. `processed.url`.
|
61
56
|
|
57
|
+
*Chedli Bourguiba* and *Jonathan Hefner*
|
62
58
|
|
63
|
-
|
59
|
+
* Prevent `ActiveRecord::StrictLoadingViolationError` when strict loading is
|
60
|
+
enabled and the variant of an Active Storage preview has already been
|
61
|
+
processed (for example, by calling `ActiveStorage::Preview#url`).
|
64
62
|
|
65
|
-
*
|
66
|
-
|
67
|
-
|
68
|
-
## Rails 7.0.4.3 (March 13, 2023) ##
|
69
|
-
|
70
|
-
* No changes.
|
71
|
-
|
72
|
-
|
73
|
-
## Rails 7.0.4.2 (January 24, 2023) ##
|
74
|
-
|
75
|
-
* No changes.
|
76
|
-
|
77
|
-
|
78
|
-
## Rails 7.0.4.1 (January 17, 2023) ##
|
79
|
-
|
80
|
-
* No changes.
|
81
|
-
|
82
|
-
|
83
|
-
## Rails 7.0.4 (September 09, 2022) ##
|
84
|
-
|
85
|
-
* Fixes proxy downloads of files over 5MiB
|
63
|
+
*Jonathan Hefner*
|
86
64
|
|
87
|
-
|
88
|
-
services like S3 via proxy mode could return corrupted files at around
|
89
|
-
5.2mb or cause random halts in the download. Now,
|
90
|
-
`ActiveStorage::Blobs::ProxyController` correctly handles streaming these
|
91
|
-
larger files from the service to the client without any issues.
|
65
|
+
* Fix `preprocessed: true` option for named variants of previewable files.
|
92
66
|
|
93
|
-
|
67
|
+
*Nico Wenterodt*
|
94
68
|
|
95
|
-
*Felipe Raul*
|
96
69
|
|
97
|
-
## Rails 7.
|
70
|
+
## Rails 7.1.2 (November 10, 2023) ##
|
98
71
|
|
99
72
|
* No changes.
|
100
73
|
|
101
74
|
|
102
|
-
## Rails 7.
|
103
|
-
|
104
|
-
* Don't stream responses in redirect mode
|
105
|
-
|
106
|
-
Previously, both redirect mode and proxy mode streamed their
|
107
|
-
responses which caused a new thread to be created, and could end
|
108
|
-
up leaking connections in the connection pool. But since redirect
|
109
|
-
mode doesn't actually send any data, it doesn't need to be
|
110
|
-
streamed.
|
111
|
-
|
112
|
-
*Luke Lau*
|
113
|
-
|
114
|
-
## Rails 7.0.2.4 (April 26, 2022) ##
|
75
|
+
## Rails 7.1.1 (October 11, 2023) ##
|
115
76
|
|
116
77
|
* No changes.
|
117
78
|
|
118
79
|
|
119
|
-
## Rails 7.0
|
120
|
-
|
121
|
-
* Added image transformation validation via configurable allow-list.
|
122
|
-
|
123
|
-
Variant now offers a configurable allow-list for
|
124
|
-
transformation methods in addition to a configurable deny-list for arguments.
|
125
|
-
|
126
|
-
[CVE-2022-21831]
|
127
|
-
|
128
|
-
|
129
|
-
## Rails 7.0.2.2 (February 11, 2022) ##
|
80
|
+
## Rails 7.1.0 (October 05, 2023) ##
|
130
81
|
|
131
82
|
* No changes.
|
132
83
|
|
133
|
-
## Rails 7.0.2.1 (February 11, 2022) ##
|
134
84
|
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
## Rails 7.0.2 (February 08, 2022) ##
|
139
|
-
|
140
|
-
* Revert the ability to pass `service_name` param to `DirectUploadsController` which was introduced
|
141
|
-
in 7.0.0.
|
142
|
-
|
143
|
-
That change caused a lot of problems to upgrade Rails applications so we decided to remove it
|
144
|
-
while in work in a more backwards compatible implementation.
|
145
|
-
|
146
|
-
*Gannon McGibbon*
|
147
|
-
|
148
|
-
* Allow applications to opt out of precompiling Active Storage JavaScript assets.
|
149
|
-
|
150
|
-
*jlestavel*
|
151
|
-
|
152
|
-
|
153
|
-
## Rails 7.0.1 (January 06, 2022) ##
|
85
|
+
## Rails 7.1.0.rc2 (October 01, 2023) ##
|
154
86
|
|
155
87
|
* No changes.
|
156
88
|
|
157
89
|
|
158
|
-
## Rails 7.0.
|
90
|
+
## Rails 7.1.0.rc1 (September 27, 2023) ##
|
159
91
|
|
160
|
-
*
|
92
|
+
* Add `expires_at` option to `ActiveStorage::Blob#signed_id`.
|
161
93
|
|
162
94
|
```ruby
|
163
|
-
|
164
|
-
|
95
|
+
rails_blob_path(user.avatar, disposition: "attachment", expires_at: 30.minutes.from_now)
|
96
|
+
<%= image_tag rails_blob_path(user.avatar.variant(resize: "100x100"), expires_at: 30.minutes.from_now) %>
|
165
97
|
```
|
166
98
|
|
167
|
-
*
|
168
|
-
|
169
|
-
|
170
|
-
## Rails 7.0.0.rc3 (December 14, 2021) ##
|
171
|
-
|
172
|
-
* No changes.
|
173
|
-
|
174
|
-
|
175
|
-
## Rails 7.0.0.rc2 (December 14, 2021) ##
|
176
|
-
|
177
|
-
* No changes.
|
178
|
-
|
179
|
-
## Rails 7.0.0.rc1 (December 06, 2021) ##
|
180
|
-
|
181
|
-
* `Add ActiveStorage::Blob.compose` to concatenate multiple blobs.
|
182
|
-
|
183
|
-
*Gannon McGibbon*
|
99
|
+
*Aki*
|
184
100
|
|
185
|
-
*
|
101
|
+
* Allow attaching File and Pathname when assigning attributes, e.g.
|
186
102
|
|
187
|
-
|
188
|
-
|
189
|
-
|
103
|
+
```ruby
|
104
|
+
User.create!(avatar: File.open("image.jpg"))
|
105
|
+
User.create!(avatar: file_fixture("image.jpg"))
|
106
|
+
```
|
190
107
|
|
191
|
-
*
|
108
|
+
*Dorian Marié*
|
192
109
|
|
193
|
-
* Invalid default content types are deprecated
|
194
110
|
|
195
|
-
|
196
|
-
a deprecation warning, since these are not valid content types.
|
111
|
+
## Rails 7.1.0.beta1 (September 13, 2023) ##
|
197
112
|
|
198
|
-
|
113
|
+
* Disables the session in `ActiveStorage::Blobs::ProxyController`
|
114
|
+
and `ActiveStorage::Representations::ProxyController`
|
115
|
+
in order to allow caching by default in some CDNs as CloudFlare
|
199
116
|
|
200
|
-
|
117
|
+
Fixes #44136
|
201
118
|
|
202
|
-
*
|
119
|
+
*Bruno Prieto*
|
203
120
|
|
204
|
-
|
121
|
+
* Add `tags` to `ActiveStorage::Analyzer::AudioAnalyzer` output
|
205
122
|
|
206
|
-
*
|
123
|
+
*Keaton Roux*
|
207
124
|
|
125
|
+
* Add an option to preprocess variants
|
208
126
|
|
209
|
-
|
127
|
+
ActiveStorage variants are processed on the fly when they are needed but
|
128
|
+
sometimes we're sure that they are accessed and want to processed them
|
129
|
+
upfront.
|
210
130
|
|
211
|
-
|
131
|
+
`preprocessed` option is added when declaring variants.
|
212
132
|
|
213
|
-
|
133
|
+
```
|
134
|
+
class User < ApplicationRecord
|
135
|
+
has_one_attached :avatar do |attachable|
|
136
|
+
attachable.variant :thumb, resize_to_limit: [100, 100], preprocessed: true
|
137
|
+
end
|
138
|
+
end
|
139
|
+
```
|
214
140
|
|
215
141
|
*Shouichi Kamiya*
|
216
142
|
|
217
|
-
*
|
218
|
-
|
219
|
-
*Tom Prats*
|
220
|
-
|
221
|
-
* Attachments can be deleted after their association is no longer defined.
|
143
|
+
* Fix variants not included when eager loading multiple records containing a single attachment
|
222
144
|
|
223
|
-
|
145
|
+
When using the `with_attached_#{name}` scope for a `has_one_attached` relation,
|
146
|
+
attachment variants were not eagerly loaded.
|
224
147
|
|
225
|
-
*
|
148
|
+
*Russell Porter*
|
226
149
|
|
227
|
-
*
|
150
|
+
* Allow an ActiveStorage attachment to be removed via a form post
|
228
151
|
|
229
|
-
|
230
|
-
|
231
|
-
|
232
|
-
|
233
|
-
|
234
|
-
* Deprecate `ActiveStorage::Current.host` in favor of `ActiveStorage::Current.url_options` which accepts
|
235
|
-
a host, protocol and port.
|
152
|
+
Attachments can already be removed by updating the attachment to be nil such as:
|
153
|
+
```ruby
|
154
|
+
User.find(params[:id]).update!(avatar: nil)
|
155
|
+
```
|
236
156
|
|
237
|
-
|
157
|
+
However, a form cannot post a nil param, it can only post an empty string. But, posting an
|
158
|
+
empty string would result in an `ActiveSupport::MessageVerifier::InvalidSignature: mismatched digest`
|
159
|
+
error being raised, because it's being treated as a signed blob id.
|
238
160
|
|
239
|
-
|
161
|
+
Now, nil and an empty string are treated as a delete, which allows attachments to be removed via:
|
162
|
+
```ruby
|
163
|
+
User.find(params[:id]).update!(params.require(:user).permit(:avatar))
|
240
164
|
|
241
|
-
```yaml
|
242
|
-
gcs:
|
243
|
-
service: GCS
|
244
|
-
...
|
245
|
-
iam: true
|
246
165
|
```
|
247
166
|
|
248
|
-
*
|
249
|
-
|
250
|
-
* OpenSSL constants are now used for Digest computations.
|
167
|
+
*Nate Matykiewicz*
|
251
168
|
|
252
|
-
|
169
|
+
* Remove mini_mime usage in favour of marcel.
|
253
170
|
|
254
|
-
|
255
|
-
|
171
|
+
We have two libraries that are have similar usage. This change removes
|
172
|
+
dependency on mini_mime and makes use of similar methods from marcel.
|
256
173
|
|
257
|
-
*
|
174
|
+
*Vipul A M*
|
258
175
|
|
259
|
-
*
|
260
|
-
and `service_url` in favor of `url`.
|
261
|
-
|
262
|
-
*Santiago Bartesaghi*
|
176
|
+
* Allow destroying active storage variants
|
263
177
|
|
264
|
-
|
178
|
+
```ruby
|
179
|
+
User.first.avatar.variant(resize_to_limit: [100, 100]).destroy
|
180
|
+
```
|
265
181
|
|
266
|
-
*
|
182
|
+
*Shouichi Kamiya*, *Yuichiro NAKAGAWA*, *Ryohei UEDA*
|
267
183
|
|
268
|
-
*
|
184
|
+
* Add `sample_rate` to `ActiveStorage::Analyzer::AudioAnalyzer` output
|
269
185
|
|
270
|
-
*
|
186
|
+
*Matija Čupić*
|
271
187
|
|
272
|
-
*
|
188
|
+
* Remove deprecated `purge` and `purge_later` methods from the attachments association.
|
273
189
|
|
274
|
-
*
|
190
|
+
*Rafael Mendonça França*
|
275
191
|
|
276
|
-
*
|
192
|
+
* Remove deprecated behavior when assigning to a collection of attachments.
|
277
193
|
|
278
|
-
|
279
|
-
`true` if the file has an video channel and `false` if it doesn't.
|
194
|
+
Instead of appending to the collection, the collection is now replaced.
|
280
195
|
|
281
|
-
*
|
196
|
+
*Rafael Mendonça França*
|
282
197
|
|
283
|
-
*
|
198
|
+
* Remove deprecated `ActiveStorage::Current#host` and `ActiveStorage::Current#host=` methods.
|
284
199
|
|
285
|
-
*
|
200
|
+
*Rafael Mendonça França*
|
286
201
|
|
287
|
-
*
|
202
|
+
* Remove deprecated invalid default content types in Active Storage configurations.
|
288
203
|
|
289
|
-
|
290
|
-
the S3 Presigner, enabling, amongst other options, custom S3 domain URL
|
291
|
-
Generation.
|
204
|
+
*Rafael Mendonça França*
|
292
205
|
|
293
|
-
|
294
|
-
blob = ActiveStorage::Blob.last
|
206
|
+
* Add missing preview event to `ActiveStorage::LogSubscriber`
|
295
207
|
|
296
|
-
|
297
|
-
|
298
|
-
```
|
208
|
+
A `preview` event is being instrumented in `ActiveStorage::Previewer`.
|
209
|
+
However it was not added inside ActiveStorage's LogSubscriber class.
|
299
210
|
|
300
|
-
|
211
|
+
This will allow to have logs for when a preview happens
|
212
|
+
in the same fashion as all other ActiveStorage events such as
|
213
|
+
`upload` and `download` inside `Rails.logger`.
|
301
214
|
|
302
|
-
*
|
215
|
+
*Chedli Bourguiba*
|
303
216
|
|
304
|
-
|
305
|
-
gcs:
|
306
|
-
service: GCS
|
307
|
-
...
|
308
|
-
cache_control: "public, max-age=3600"
|
309
|
-
```
|
217
|
+
* Fix retrieving rotation value from FFmpeg on version 5.0+.
|
310
218
|
|
311
|
-
|
219
|
+
In FFmpeg version 5.0+ the rotation value has been removed from tags.
|
220
|
+
Instead the value can be found in side_data_list. Along with
|
221
|
+
this update it's possible to have values of -90, -270 to denote the video
|
222
|
+
has been rotated.
|
312
223
|
|
313
|
-
*
|
314
|
-
configurable under `config.active_storage.video_preview_arguments`.
|
224
|
+
*Haroon Ahmed*
|
315
225
|
|
316
|
-
|
226
|
+
* Touch all corresponding model records after ActiveStorage::Blob is analyzed
|
317
227
|
|
318
|
-
|
319
|
-
|
320
|
-
|
228
|
+
This fixes a race condition where a record can be requested and have a cache entry built, before
|
229
|
+
the initial `analyze_later` completes, which will not be invalidated until something else
|
230
|
+
updates the record. This also invalidates cache entries when a blob is re-analyzed, which
|
231
|
+
is helpful if a bug is fixed in an analyzer or a new analyzer is added.
|
321
232
|
|
322
|
-
*
|
233
|
+
*Nate Matykiewicz*
|
323
234
|
|
324
|
-
* Add
|
235
|
+
* Add ability to use pre-defined variants when calling `preview` or
|
236
|
+
`representation` on an attachment.
|
325
237
|
|
326
238
|
```ruby
|
327
|
-
|
239
|
+
class User < ActiveRecord::Base
|
240
|
+
has_one_attached :file do |attachable|
|
241
|
+
attachable.variant :thumb, resize_to_limit: [100, 100]
|
242
|
+
end
|
243
|
+
end
|
328
244
|
|
329
|
-
<%= image_tag
|
245
|
+
<%= image_tag user.file.representation(:thumb) %>
|
330
246
|
```
|
331
247
|
|
332
|
-
|
248
|
+
*Richard Böhme*
|
333
249
|
|
334
|
-
|
250
|
+
* Method `attach` always returns the attachments except when the record
|
251
|
+
is persisted, unchanged, and saving it fails, in which case it returns `nil`.
|
335
252
|
|
336
|
-
*
|
337
|
-
|
338
|
-
*Jacopo Beschi*
|
339
|
-
|
340
|
-
* Add `with_all_variant_records` method to eager load all variant records on an attachment at once.
|
341
|
-
`with_attached_image` scope now eager loads variant records if using variant tracking.
|
342
|
-
|
343
|
-
*Alex Ghiculescu*
|
344
|
-
|
345
|
-
* Add metadata value for presence of audio channel in video blobs.
|
346
|
-
|
347
|
-
The `metadata` attribute of video blobs has a new boolean key named `audio` that is set to
|
348
|
-
`true` if the file has an audio channel and `false` if it doesn't.
|
349
|
-
|
350
|
-
*Breno Gazzola*
|
351
|
-
|
352
|
-
* Adds analyzer for audio files.
|
353
|
-
|
354
|
-
*Breno Gazzola*
|
355
|
-
|
356
|
-
* Respect Active Record's primary_key_type in Active Storage migrations.
|
357
|
-
|
358
|
-
*fatkodima*
|
253
|
+
*Santiago Bartesaghi*
|
359
254
|
|
360
|
-
*
|
255
|
+
* Fixes multiple `attach` calls within transaction not uploading files correctly.
|
361
256
|
|
362
|
-
|
257
|
+
In the following example, the code failed to upload all but the last file to the configured service.
|
258
|
+
```ruby
|
259
|
+
ActiveRecord::Base.transaction do
|
260
|
+
user.attachments.attach({
|
261
|
+
content_type: "text/plain",
|
262
|
+
filename: "dummy.txt",
|
263
|
+
io: ::StringIO.new("dummy"),
|
264
|
+
})
|
265
|
+
user.attachments.attach({
|
266
|
+
content_type: "text/plain",
|
267
|
+
filename: "dummy2.txt",
|
268
|
+
io: ::StringIO.new("dummy2"),
|
269
|
+
})
|
270
|
+
end
|
363
271
|
|
364
|
-
|
272
|
+
assert_equal 2, user.attachments.count
|
273
|
+
assert user.attachments.first.service.exist?(user.attachments.first.key) # Fails
|
274
|
+
```
|
365
275
|
|
366
|
-
|
276
|
+
This was addressed by keeping track of the subchanges pending upload, and uploading them
|
277
|
+
once the transaction is committed.
|
367
278
|
|
368
|
-
|
369
|
-
to allow for overriding aspects of the `ActiveStorage::VariantRecord` class. This makes
|
370
|
-
`ActiveStorage::VariantRecord` consistent with `ActiveStorage::Blob` and `ActiveStorage::Attachment`
|
371
|
-
that already have load hooks.
|
279
|
+
Fixes #41661
|
372
280
|
|
373
|
-
*
|
281
|
+
*Santiago Bartesaghi*, *Bruno Vezoli*, *Juan Roig*, *Abhay Nikam*
|
374
282
|
|
375
|
-
*
|
283
|
+
* Raise an exception if `config.active_storage.service` is not set.
|
376
284
|
|
377
|
-
|
285
|
+
If Active Storage is configured and `config.active_storage.service` is not
|
286
|
+
set in the respective environment's configuration file, then an exception
|
287
|
+
is raised with a meaningful message when attempting to use Active Storage.
|
378
288
|
|
379
|
-
*
|
380
|
-
which wraps the new `ActionController::Base#send_stream` method to stream a blob from cloud storage:
|
289
|
+
*Ghouse Mohamed*
|
381
290
|
|
382
|
-
|
383
|
-
class MyPublicBlobsController < ApplicationController
|
384
|
-
include ActiveStorage::SetBlob, ActiveStorage::Streaming
|
291
|
+
* Fixes proxy downloads of files over 5mb
|
385
292
|
|
386
|
-
|
387
|
-
|
388
|
-
|
389
|
-
|
390
|
-
|
391
|
-
end
|
392
|
-
```
|
293
|
+
Previously, trying to view and/or download files larger than 5mb stored in
|
294
|
+
services like S3 via proxy mode could return corrupted files at around
|
295
|
+
5.2mb or cause random halts in the download. Now,
|
296
|
+
`ActiveStorage::Blobs::ProxyController` correctly handles streaming these
|
297
|
+
larger files from the service to the client without any issues.
|
393
298
|
|
394
|
-
|
299
|
+
Fixes #44679
|
395
300
|
|
396
|
-
*
|
301
|
+
*Felipe Raul*
|
397
302
|
|
398
|
-
|
399
|
-
class User < ActiveRecord::Base
|
400
|
-
has_one_attached :avatar do |attachable|
|
401
|
-
attachable.variant :thumb, resize: "100x100"
|
402
|
-
attachable.variant :medium, resize: "300x300", monochrome: true
|
403
|
-
end
|
404
|
-
end
|
303
|
+
* Saving attachment(s) to a record returns the blob/blobs object
|
405
304
|
|
406
|
-
|
407
|
-
|
408
|
-
|
409
|
-
|
410
|
-
|
411
|
-
end
|
305
|
+
Previously, saving attachments did not return the blob/blobs that
|
306
|
+
were attached. Now, saving attachments to a record with `#attach`
|
307
|
+
method returns the blob or array of blobs that were attached to
|
308
|
+
the record. If it fails to save the attachment(s), then it returns
|
309
|
+
`false`.
|
412
310
|
|
413
|
-
|
414
|
-
```
|
311
|
+
*Ghouse Mohamed*
|
415
312
|
|
416
|
-
|
313
|
+
* Don't stream responses in redirect mode
|
417
314
|
|
418
|
-
|
419
|
-
|
315
|
+
Previously, both redirect mode and proxy mode streamed their
|
316
|
+
responses which caused a new thread to be created, and could end
|
317
|
+
up leaking connections in the connection pool. But since redirect
|
318
|
+
mode doesn't actually send any data, it doesn't need to be
|
319
|
+
streamed.
|
420
320
|
|
421
|
-
*
|
321
|
+
*Luke Lau*
|
422
322
|
|
423
|
-
*
|
424
|
-
improve fixture integration.
|
323
|
+
* Safe for direct upload on Libraries or Frameworks
|
425
324
|
|
426
|
-
|
325
|
+
Enable the use of custom headers during direct uploads, which allows for
|
326
|
+
the inclusion of Authorization bearer tokens or other forms of authorization
|
327
|
+
tokens through headers.
|
427
328
|
|
329
|
+
*Radamés Roriz*
|
428
330
|
|
429
|
-
Please check [
|
331
|
+
Please check [7-0-stable](https://github.com/rails/rails/blob/7-0-stable/activestorage/CHANGELOG.md) for previous changes.
|
data/MIT-LICENSE
CHANGED