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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4ac8e40a86bf44dc69e65c05ad50878b97d02eb9b356cb4262a373f1db2d9e28
4
- data.tar.gz: d7da6030ad8d447594bac1a6ad4894ace3b6bc106533a97764f8208f979bd26e
3
+ metadata.gz: e40851af6b9bf07e36ad4a7133f5d35a3291ccafe10ab1cde9d865122e7fbfbf
4
+ data.tar.gz: 71510a056f86062a2a796cbddd172f0e4e32c901bfc606b91a749804303bbba1
5
5
  SHA512:
6
- metadata.gz: 1045172baf900f8a9814c24699197c728166e2ec7553045406e9861fab2d7987f37e9ec53fc03951b5ca47e5ebd68860469040e065accba9d611abbf57f8d734
7
- data.tar.gz: 1988d991380ff9465d2d3d9a931ed8188756786b4986753bbd7c7a18483e6f5c4d25eabbfe836e35f51abd01306e4ac1dc3b6247093e554994c2840282814948
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/master/activestorage/app/models/active_storage/blob.rb) and [Attachment](https://github.com/rails/rails/blob/master/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`.
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
 
@@ -1,7 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require "active_storage/downloader"
4
-
5
3
  # A blob is a record that contains the metadata about a file and a key for where that file resides on the service.
6
4
  # Blobs can be created in two ways:
7
5
  #
@@ -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
- @active_storage_attached_#{name} ||= ActiveStorage::Attached::One.new("#{name}", self)
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
- @active_storage_attached_#{name} ||= ActiveStorage::Attached::Many.new("#{name}", self)
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
@@ -9,8 +9,8 @@ module ActiveStorage
9
9
  module VERSION
10
10
  MAJOR = 6
11
11
  MINOR = 0
12
- TINY = 3
13
- PRE = "3"
12
+ TINY = 4
13
+ PRE = nil
14
14
 
15
15
  STRING = [MAJOR, MINOR, TINY, PRE].compact.join(".")
16
16
  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
@@ -1,6 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require "active_storage/log_subscriber"
4
+ require "active_storage/downloader"
4
5
  require "action_dispatch"
5
6
  require "action_dispatch/http/content_disposition"
6
7
 
@@ -1,5 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ gem "aws-sdk-s3", "~> 1.48"
4
+
3
5
  require "aws-sdk-s3"
4
6
  require "active_support/core_ext/numeric/bytes"
5
7
 
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.3.3
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: 2020-09-09 00:00:00.000000000 Z
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.3.3
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.3.3
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.3.3
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.3.3
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.3.3
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.3.3
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.3.1
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.3.1
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.3.3/activestorage/CHANGELOG.md
155
- documentation_uri: https://api.rubyonrails.org/v6.0.3.3/
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.3.3/activestorage
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: