activestorage 6.0.3.3 → 6.0.4
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 +33 -0
- data/README.md +1 -1
- data/app/models/active_storage/blob.rb +0 -2
- data/lib/active_storage/attached/changes/create_one.rb +1 -1
- data/lib/active_storage/attached/model.rb +10 -2
- data/lib/active_storage/gem_version.rb +2 -2
- data/lib/active_storage/previewer/poppler_pdf_previewer.rb +1 -1
- data/lib/active_storage/service.rb +1 -0
- data/lib/active_storage/service/s3_service.rb +2 -0
- metadata +13 -13
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e40851af6b9bf07e36ad4a7133f5d35a3291ccafe10ab1cde9d865122e7fbfbf
|
4
|
+
data.tar.gz: 71510a056f86062a2a796cbddd172f0e4e32c901bfc606b91a749804303bbba1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: dd391607b9d0a43217ad794efd9644a800d3bbe04b8c2927959429d1d1fa7c7da18507ab722588082d3b7a863192f961d0ca3a78146d63ac929e597635f03c17
|
7
|
+
data.tar.gz: 70fccf7e11af2be2b8a3102981207351c5850ef94bf1526032b8fb462290e81c03314285cdc376943f26c0f7867880c6a2bf0e8e29f6991bcce7e6c6c188b426
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,35 @@
|
|
1
|
+
## Rails 6.0.4 (June 15, 2021) ##
|
2
|
+
|
3
|
+
* The Poppler PDF previewer renders a preview image using the original
|
4
|
+
document's crop box rather than its media box, hiding print margins. This
|
5
|
+
matches the behavior of the MuPDF previewer.
|
6
|
+
|
7
|
+
*Vincent Robert*
|
8
|
+
|
9
|
+
|
10
|
+
## Rails 6.0.3.7 (May 05, 2021) ##
|
11
|
+
|
12
|
+
* No changes.
|
13
|
+
|
14
|
+
|
15
|
+
## Rails 6.0.3.6 (March 26, 2021) ##
|
16
|
+
|
17
|
+
* Marcel is upgraded to version 1.0.0 to avoid a dependency on GPL-licensed
|
18
|
+
mime types data.
|
19
|
+
|
20
|
+
*George Claghorn*
|
21
|
+
|
22
|
+
|
23
|
+
## Rails 6.0.3.5 (February 10, 2021) ##
|
24
|
+
|
25
|
+
* No changes.
|
26
|
+
|
27
|
+
|
28
|
+
## Rails 6.0.3.4 (October 07, 2020) ##
|
29
|
+
|
30
|
+
* No changes.
|
31
|
+
|
32
|
+
|
1
33
|
## Rails 6.0.3.3 (September 09, 2020) ##
|
2
34
|
|
3
35
|
* No changes.
|
@@ -12,6 +44,7 @@
|
|
12
44
|
|
13
45
|
* [CVE-2020-8162] Include Content-Length in signature for ActiveStorage direct upload
|
14
46
|
|
47
|
+
|
15
48
|
## Rails 6.0.3 (May 06, 2020) ##
|
16
49
|
|
17
50
|
* No changes.
|
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
|
|
@@ -58,7 +58,7 @@ module ActiveStorage
|
|
58
58
|
filename: attachable.original_filename,
|
59
59
|
content_type: attachable.content_type
|
60
60
|
when Hash
|
61
|
-
ActiveStorage::Blob.build_after_unfurling(**attachable)
|
61
|
+
ActiveStorage::Blob.build_after_unfurling(**attachable.symbolize_keys)
|
62
62
|
when String
|
63
63
|
ActiveStorage::Blob.find_signed(attachable)
|
64
64
|
else
|
@@ -33,7 +33,8 @@ module ActiveStorage
|
|
33
33
|
def has_one_attached(name, dependent: :purge_later)
|
34
34
|
generated_association_methods.class_eval <<-CODE, __FILE__, __LINE__ + 1
|
35
35
|
def #{name}
|
36
|
-
@
|
36
|
+
@active_storage_attached ||= {}
|
37
|
+
@active_storage_attached[:#{name}] ||= ActiveStorage::Attached::One.new("#{name}", self)
|
37
38
|
end
|
38
39
|
|
39
40
|
def #{name}=(attachable)
|
@@ -89,7 +90,8 @@ module ActiveStorage
|
|
89
90
|
def has_many_attached(name, dependent: :purge_later)
|
90
91
|
generated_association_methods.class_eval <<-CODE, __FILE__, __LINE__ + 1
|
91
92
|
def #{name}
|
92
|
-
@
|
93
|
+
@active_storage_attached ||= {}
|
94
|
+
@active_storage_attached[:#{name}] ||= ActiveStorage::Attached::Many.new("#{name}", self)
|
93
95
|
end
|
94
96
|
|
95
97
|
def #{name}=(attachables)
|
@@ -144,6 +146,12 @@ module ActiveStorage
|
|
144
146
|
super || attachment_changes.any?
|
145
147
|
end
|
146
148
|
|
149
|
+
def initialize_dup(*) #:nodoc:
|
150
|
+
super
|
151
|
+
@active_storage_attached = nil
|
152
|
+
@attachment_changes = nil
|
153
|
+
end
|
154
|
+
|
147
155
|
def reload(*) #:nodoc:
|
148
156
|
super.tap { @attachment_changes = nil }
|
149
157
|
end
|
@@ -29,7 +29,7 @@ module ActiveStorage
|
|
29
29
|
private
|
30
30
|
def draw_first_page_from(file, &block)
|
31
31
|
# use 72 dpi to match thumbnail dimensions of the PDF
|
32
|
-
draw self.class.pdftoppm_path, "-singlefile", "-r", "72", "-png", file.path, &block
|
32
|
+
draw self.class.pdftoppm_path, "-singlefile", "-cropbox", "-r", "72", "-png", file.path, &block
|
33
33
|
end
|
34
34
|
end
|
35
35
|
end
|
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.0.
|
4
|
+
version: 6.0.4
|
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-06-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: actionpack
|
@@ -16,56 +16,56 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - '='
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 6.0.
|
19
|
+
version: 6.0.4
|
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.0.
|
26
|
+
version: 6.0.4
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: activejob
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
31
|
- - '='
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: 6.0.
|
33
|
+
version: 6.0.4
|
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.0.
|
40
|
+
version: 6.0.4
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: activerecord
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
45
|
- - '='
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version: 6.0.
|
47
|
+
version: 6.0.4
|
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.0.
|
54
|
+
version: 6.0.4
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: marcel
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
59
|
- - "~>"
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version: 0.
|
61
|
+
version: 1.0.0
|
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: 0.
|
68
|
+
version: 1.0.0
|
69
69
|
description: Attach cloud and local files in Rails applications.
|
70
70
|
email: david@loudthinking.com
|
71
71
|
executables: []
|
@@ -151,10 +151,10 @@ licenses:
|
|
151
151
|
- MIT
|
152
152
|
metadata:
|
153
153
|
bug_tracker_uri: https://github.com/rails/rails/issues
|
154
|
-
changelog_uri: https://github.com/rails/rails/blob/v6.0.
|
155
|
-
documentation_uri: https://api.rubyonrails.org/v6.0.
|
154
|
+
changelog_uri: https://github.com/rails/rails/blob/v6.0.4/activestorage/CHANGELOG.md
|
155
|
+
documentation_uri: https://api.rubyonrails.org/v6.0.4/
|
156
156
|
mailing_list_uri: https://discuss.rubyonrails.org/c/rubyonrails-talk
|
157
|
-
source_code_uri: https://github.com/rails/rails/tree/v6.0.
|
157
|
+
source_code_uri: https://github.com/rails/rails/tree/v6.0.4/activestorage
|
158
158
|
post_install_message:
|
159
159
|
rdoc_options: []
|
160
160
|
require_paths:
|