activestorage 6.1.0 → 6.1.3.1
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of activestorage might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/CHANGELOG.md +30 -0
- data/README.md +1 -1
- data/app/models/active_storage/blob.rb +10 -2
- data/app/models/active_storage/blob/representable.rb +3 -3
- data/app/models/active_storage/variation.rb +3 -3
- data/lib/active_storage/gem_version.rb +2 -2
- data/lib/active_storage/service/s3_service.rb +1 -1
- metadata +19 -19
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 645186a399a2dbb7842cf5aad3138fd0b33cae1e5906c36b41095ae530c4df75
|
4
|
+
data.tar.gz: 722028d745d419c548fdb944c0f9fb39267dcc8a0d110202857d8356acc46211
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 63a5dfbd6fac7fbbfaecc30e3f95efc03242ba5d5785b952914a80c30807f6699954b9b4b5e31c26be8f2573785c0bd50b13358063acb690abf694cc04c8fe98
|
7
|
+
data.tar.gz: 0d3e165f3722f166f033735f7cb4203206727980f542d8f8687ff8560dc3d2f67830b928d1c5e33e4279323b3fbbc0cbfdec15d27935fbe6edcd823ed4dcd8a2
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,33 @@
|
|
1
|
+
## Rails 6.1.3.1 (March 26, 2021) ##
|
2
|
+
|
3
|
+
* Marcel is upgraded to version 1.0.0 to avoid a dependency on GPL-licensed
|
4
|
+
mime types data.
|
5
|
+
|
6
|
+
*George Claghorn*
|
7
|
+
|
8
|
+
|
9
|
+
## Rails 6.1.3 (February 17, 2021) ##
|
10
|
+
|
11
|
+
* No changes.
|
12
|
+
|
13
|
+
|
14
|
+
## Rails 6.1.2.1 (February 10, 2021) ##
|
15
|
+
|
16
|
+
* No changes.
|
17
|
+
|
18
|
+
|
19
|
+
## Rails 6.1.2 (February 09, 2021) ##
|
20
|
+
|
21
|
+
* No changes.
|
22
|
+
|
23
|
+
|
24
|
+
## Rails 6.1.1 (January 07, 2021) ##
|
25
|
+
|
26
|
+
* Fix S3 multipart uploads when threshold is larger than file.
|
27
|
+
|
28
|
+
*Matt Muller*
|
29
|
+
|
30
|
+
|
1
31
|
## Rails 6.1.0 (December 09, 2020) ##
|
2
32
|
|
3
33
|
* Change default queue name of the analysis (`:active_storage_analysis`) and
|
data/README.md
CHANGED
@@ -10,7 +10,7 @@ You can read more about Active Storage in the [Active Storage Overview](https://
|
|
10
10
|
|
11
11
|
## Compared to other storage solutions
|
12
12
|
|
13
|
-
A key difference to how Active Storage works compared to other attachment solutions in Rails is through the use of built-in [Blob](https://github.com/rails/rails/blob/
|
13
|
+
A key difference to how Active Storage works compared to other attachment solutions in Rails is through the use of built-in [Blob](https://github.com/rails/rails/blob/main/activestorage/app/models/active_storage/blob.rb) and [Attachment](https://github.com/rails/rails/blob/main/activestorage/app/models/active_storage/attachment.rb) models (backed by Active Record). This means existing application models do not need to be modified with additional columns to associate with files. Active Storage uses polymorphic associations via the `Attachment` join model, which then connects to the actual `Blob`.
|
14
14
|
|
15
15
|
`Blob` models store attachment metadata (filename, content-type, etc.), and their identifier key in the storage service. Blob models do not store the actual binary data. They are intended to be immutable in spirit. One file, one blob. You can associate the same blob with multiple application models as well. And if you want to do transformations of a given `Blob`, the idea is that you'll simply create a new one, rather than attempt to mutate the existing one (though of course you can delete the previous version later if you don't need it).
|
16
16
|
|
@@ -74,8 +74,16 @@ class ActiveStorage::Blob < ActiveStorage::Record
|
|
74
74
|
# that was created ahead of the upload itself on form submission.
|
75
75
|
#
|
76
76
|
# The signed ID is also used to create stable URLs for the blob through the BlobsController.
|
77
|
-
def find_signed
|
78
|
-
super(id, purpose:
|
77
|
+
def find_signed(id, record: nil, purpose: :blob_id)
|
78
|
+
super(id, purpose: purpose)
|
79
|
+
end
|
80
|
+
|
81
|
+
# Works like +find_signed+, but will raise an +ActiveSupport::MessageVerifier::InvalidSignature+
|
82
|
+
# exception if the +signed_id+ has either expired, has a purpose mismatch, is for another record,
|
83
|
+
# or has been tampered with. It will also raise an +ActiveRecord::RecordNotFound+ exception if
|
84
|
+
# the valid signed id can't find a record.
|
85
|
+
def find_signed!(id, record: nil, purpose: :blob_id)
|
86
|
+
super(id, purpose: purpose)
|
79
87
|
end
|
80
88
|
|
81
89
|
def build_after_upload(io:, filename:, content_type: nil, metadata: nil, service_name: nil, identify: true, record: nil) #:nodoc:
|
@@ -1,6 +1,6 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require "
|
3
|
+
require "mini_mime"
|
4
4
|
|
5
5
|
module ActiveStorage::Blob::Representable
|
6
6
|
extend ActiveSupport::Concern
|
@@ -110,10 +110,10 @@ module ActiveStorage::Blob::Representable
|
|
110
110
|
end
|
111
111
|
|
112
112
|
def format
|
113
|
-
if filename.extension.present? &&
|
113
|
+
if filename.extension.present? && MiniMime.lookup_by_extension(filename.extension)&.content_type == content_type
|
114
114
|
filename.extension
|
115
115
|
else
|
116
|
-
|
116
|
+
MiniMime.lookup_by_content_type(content_type).extension
|
117
117
|
end
|
118
118
|
end
|
119
119
|
|
@@ -1,6 +1,6 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require "
|
3
|
+
require "mini_mime"
|
4
4
|
|
5
5
|
# A set of transformations that can be applied to a blob to create a variant. This class is exposed via
|
6
6
|
# the ActiveStorage::Blob#variant method and should rarely be used directly.
|
@@ -59,14 +59,14 @@ class ActiveStorage::Variation
|
|
59
59
|
|
60
60
|
def format
|
61
61
|
transformations.fetch(:format, :png).tap do |format|
|
62
|
-
if
|
62
|
+
if MiniMime.lookup_by_extension(format.to_s).nil?
|
63
63
|
raise ArgumentError, "Invalid variant format (#{format.inspect})"
|
64
64
|
end
|
65
65
|
end
|
66
66
|
end
|
67
67
|
|
68
68
|
def content_type
|
69
|
-
|
69
|
+
MiniMime.lookup_by_extension(format.to_s).content_type
|
70
70
|
end
|
71
71
|
|
72
72
|
# Returns a signed key for all the +transformations+ that this variation was instantiated with.
|
@@ -16,7 +16,7 @@ module ActiveStorage
|
|
16
16
|
@client = Aws::S3::Resource.new(**options)
|
17
17
|
@bucket = @client.bucket(bucket)
|
18
18
|
|
19
|
-
@multipart_upload_threshold = upload.
|
19
|
+
@multipart_upload_threshold = upload.delete(:multipart_threshold) || 100.megabytes
|
20
20
|
@public = public
|
21
21
|
|
22
22
|
@upload_options = upload
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: activestorage
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 6.1.
|
4
|
+
version: 6.1.3.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- David Heinemeier Hansson
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-03-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -16,84 +16,84 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - '='
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 6.1.
|
19
|
+
version: 6.1.3.1
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - '='
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 6.1.
|
26
|
+
version: 6.1.3.1
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: actionpack
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
31
|
- - '='
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: 6.1.
|
33
|
+
version: 6.1.3.1
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - '='
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: 6.1.
|
40
|
+
version: 6.1.3.1
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: activejob
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
45
|
- - '='
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version: 6.1.
|
47
|
+
version: 6.1.3.1
|
48
48
|
type: :runtime
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
52
|
- - '='
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version: 6.1.
|
54
|
+
version: 6.1.3.1
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: activerecord
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
59
|
- - '='
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version: 6.1.
|
61
|
+
version: 6.1.3.1
|
62
62
|
type: :runtime
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
66
|
- - '='
|
67
67
|
- !ruby/object:Gem::Version
|
68
|
-
version: 6.1.
|
68
|
+
version: 6.1.3.1
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: marcel
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
72
72
|
requirements:
|
73
73
|
- - "~>"
|
74
74
|
- !ruby/object:Gem::Version
|
75
|
-
version: 0.
|
75
|
+
version: 1.0.0
|
76
76
|
type: :runtime
|
77
77
|
prerelease: false
|
78
78
|
version_requirements: !ruby/object:Gem::Requirement
|
79
79
|
requirements:
|
80
80
|
- - "~>"
|
81
81
|
- !ruby/object:Gem::Version
|
82
|
-
version: 0.
|
82
|
+
version: 1.0.0
|
83
83
|
- !ruby/object:Gem::Dependency
|
84
|
-
name:
|
84
|
+
name: mini_mime
|
85
85
|
requirement: !ruby/object:Gem::Requirement
|
86
86
|
requirements:
|
87
87
|
- - "~>"
|
88
88
|
- !ruby/object:Gem::Version
|
89
|
-
version: 0.
|
89
|
+
version: 1.0.2
|
90
90
|
type: :runtime
|
91
91
|
prerelease: false
|
92
92
|
version_requirements: !ruby/object:Gem::Requirement
|
93
93
|
requirements:
|
94
94
|
- - "~>"
|
95
95
|
- !ruby/object:Gem::Version
|
96
|
-
version: 0.
|
96
|
+
version: 1.0.2
|
97
97
|
description: Attach cloud and local files in Rails applications.
|
98
98
|
email: david@loudthinking.com
|
99
99
|
executables: []
|
@@ -187,10 +187,10 @@ licenses:
|
|
187
187
|
- MIT
|
188
188
|
metadata:
|
189
189
|
bug_tracker_uri: https://github.com/rails/rails/issues
|
190
|
-
changelog_uri: https://github.com/rails/rails/blob/v6.1.
|
191
|
-
documentation_uri: https://api.rubyonrails.org/v6.1.
|
190
|
+
changelog_uri: https://github.com/rails/rails/blob/v6.1.3.1/activestorage/CHANGELOG.md
|
191
|
+
documentation_uri: https://api.rubyonrails.org/v6.1.3.1/
|
192
192
|
mailing_list_uri: https://discuss.rubyonrails.org/c/rubyonrails-talk
|
193
|
-
source_code_uri: https://github.com/rails/rails/tree/v6.1.
|
193
|
+
source_code_uri: https://github.com/rails/rails/tree/v6.1.3.1/activestorage
|
194
194
|
post_install_message:
|
195
195
|
rdoc_options: []
|
196
196
|
require_paths:
|
@@ -206,7 +206,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
206
206
|
- !ruby/object:Gem::Version
|
207
207
|
version: '0'
|
208
208
|
requirements: []
|
209
|
-
rubygems_version: 3.1.
|
209
|
+
rubygems_version: 3.1.2
|
210
210
|
signing_key:
|
211
211
|
specification_version: 4
|
212
212
|
summary: Local and cloud file storage framework.
|