activestorage 6.0.0.beta3 → 6.0.2.rc2
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 +41 -0
- data/README.md +4 -2
- data/app/controllers/active_storage/disk_controller.rb +1 -1
- data/app/jobs/active_storage/analyze_job.rb +1 -0
- data/app/models/active_storage/attachment.rb +2 -0
- data/app/models/active_storage/blob.rb +32 -18
- data/app/models/active_storage/variation.rb +2 -2
- data/db/update_migrate/20180723000244_add_foreign_key_constraint_to_active_storage_attachments_for_blob_id.rb +3 -1
- data/lib/active_storage.rb +13 -5
- data/lib/active_storage/analyzer.rb +2 -2
- data/lib/active_storage/analyzer/image_analyzer.rb +11 -4
- data/lib/active_storage/attached/changes/create_one.rb +1 -0
- data/lib/active_storage/attached/changes/delete_many.rb +4 -0
- data/lib/active_storage/attached/many.rb +1 -1
- data/lib/active_storage/attached/model.rb +12 -5
- data/lib/active_storage/downloader.rb +14 -15
- data/lib/active_storage/engine.rb +8 -0
- data/lib/active_storage/gem_version.rb +2 -2
- data/lib/active_storage/previewer.rb +4 -4
- data/lib/active_storage/service.rb +4 -0
- data/lib/active_storage/service/disk_service.rb +5 -1
- data/lib/active_storage/service/gcs_service.rb +1 -1
- data/lib/active_storage/transformers/image_processing_transformer.rb +1 -1
- metadata +27 -10
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 97aa68a314c14a030c72ad86d8dd19b31456ffbd1ec3151f0cc166d9841c2035
|
4
|
+
data.tar.gz: f461a8c0e68e4161c1fdf92e344fe582d6f7f74860f2ec04719a0e2d84903973
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0e050f6adc898760ec1a330d834f4eb908d0a52574842d2c85a63cbbe2dff85dda16a6c488cc5430e5d6666eb22c515fae66163cb123c62534df62c248cd000d
|
7
|
+
data.tar.gz: 3e9b04aaeb6c528b84659c823ece93925d2807afb77213d8dc02cc08cd7f4bbfe66eb97c5d99f9537f3095418e5d58bcc3c973d001a1425e66d49f6ab74977cc
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,44 @@
|
|
1
|
+
## Rails 6.0.2.rc2 (December 09, 2019) ##
|
2
|
+
|
3
|
+
* No changes.
|
4
|
+
|
5
|
+
|
6
|
+
## Rails 6.0.1 (November 5, 2019) ##
|
7
|
+
|
8
|
+
* `ActiveStorage::AnalyzeJob`s are discarded on `ActiveRecord::RecordNotFound` errors.
|
9
|
+
|
10
|
+
*George Claghorn*
|
11
|
+
|
12
|
+
* Blobs are recorded in the database before being uploaded to the service.
|
13
|
+
This fixes that generated blob keys could silently collide, leading to
|
14
|
+
data loss.
|
15
|
+
|
16
|
+
*Julik Tarkhanov*
|
17
|
+
|
18
|
+
|
19
|
+
## Rails 6.0.0 (August 16, 2019) ##
|
20
|
+
|
21
|
+
* No changes.
|
22
|
+
|
23
|
+
|
24
|
+
## Rails 6.0.0.rc2 (July 22, 2019) ##
|
25
|
+
|
26
|
+
* No changes.
|
27
|
+
|
28
|
+
|
29
|
+
## Rails 6.0.0.rc1 (April 24, 2019) ##
|
30
|
+
|
31
|
+
* Don't raise when analyzing an image whose type is unsupported by ImageMagick.
|
32
|
+
|
33
|
+
Fixes #36065.
|
34
|
+
|
35
|
+
*Guilherme Mansur*
|
36
|
+
|
37
|
+
* Permit generating variants of BMP images.
|
38
|
+
|
39
|
+
*Younes Serraj*
|
40
|
+
|
41
|
+
|
1
42
|
## Rails 6.0.0.beta3 (March 11, 2019) ##
|
2
43
|
|
3
44
|
* No changes.
|
data/README.md
CHANGED
@@ -4,7 +4,9 @@ Active Storage makes it simple to upload and reference files in cloud services l
|
|
4
4
|
|
5
5
|
Files can be uploaded from the server to the cloud or directly from the client to the cloud.
|
6
6
|
|
7
|
-
Image files can furthermore be transformed using on-demand variants for quality, aspect ratio, size, or any other [MiniMagick](https://github.com/minimagick/minimagick) or [Vips](
|
7
|
+
Image files can furthermore be transformed using on-demand variants for quality, aspect ratio, size, or any other [MiniMagick](https://github.com/minimagick/minimagick) or [Vips](https://www.rubydoc.info/gems/ruby-vips/Vips/Image) supported transformation.
|
8
|
+
|
9
|
+
You can read more about Active Storage in the [Active Storage Overview](https://edgeguides.rubyonrails.org/active_storage_overview.html) guide.
|
8
10
|
|
9
11
|
## Compared to other storage solutions
|
10
12
|
|
@@ -149,7 +151,7 @@ Active Storage is released under the [MIT License](https://opensource.org/licens
|
|
149
151
|
|
150
152
|
API documentation is at:
|
151
153
|
|
152
|
-
*
|
154
|
+
* https://api.rubyonrails.org
|
153
155
|
|
154
156
|
Bug reports for the Ruby on Rails project can be filed here:
|
155
157
|
|
@@ -3,7 +3,7 @@
|
|
3
3
|
# Serves files stored with the disk service in the same way that the cloud services do.
|
4
4
|
# This means using expiring, signed URLs that are meant for immediate access, not permanent linking.
|
5
5
|
# Always go through the BlobsController, or your own authenticated controller, rather than directly
|
6
|
-
# to the service
|
6
|
+
# to the service URL.
|
7
7
|
class ActiveStorage::DiskController < ActiveStorage::BaseController
|
8
8
|
skip_forgery_protection
|
9
9
|
|
@@ -5,8 +5,9 @@ require "active_storage/downloader"
|
|
5
5
|
# A blob is a record that contains the metadata about a file and a key for where that file resides on the service.
|
6
6
|
# Blobs can be created in two ways:
|
7
7
|
#
|
8
|
-
# 1.
|
9
|
-
#
|
8
|
+
# 1. Ahead of the file being uploaded server-side to the service, via <tt>create_and_upload!</tt>. A rewindable
|
9
|
+
# <tt>io</tt> with the file contents must be available at the server for this operation.
|
10
|
+
# 2. Ahead of the file being directly uploaded client-side to the service, via <tt>create_before_direct_upload!</tt>.
|
10
11
|
#
|
11
12
|
# The first option doesn't require any client-side JavaScript integration, and can be used by any other back-end
|
12
13
|
# service that deals with files. The second option is faster, since you're not using your own server as a staging
|
@@ -16,9 +17,11 @@ require "active_storage/downloader"
|
|
16
17
|
# update a blob's metadata on a subsequent pass, but you should not update the key or change the uploaded file.
|
17
18
|
# If you need to create a derivative or otherwise change the blob, simply create a new blob and purge the old one.
|
18
19
|
class ActiveStorage::Blob < ActiveRecord::Base
|
19
|
-
|
20
|
-
|
21
|
-
|
20
|
+
unless Rails.autoloaders.zeitwerk_enabled?
|
21
|
+
require_dependency "active_storage/blob/analyzable"
|
22
|
+
require_dependency "active_storage/blob/identifiable"
|
23
|
+
require_dependency "active_storage/blob/representable"
|
24
|
+
end
|
22
25
|
|
23
26
|
include Analyzable
|
24
27
|
include Identifiable
|
@@ -63,14 +66,23 @@ class ActiveStorage::Blob < ActiveRecord::Base
|
|
63
66
|
end
|
64
67
|
end
|
65
68
|
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
+
def create_after_unfurling!(io:, filename:, content_type: nil, metadata: nil, identify: true, record: nil) #:nodoc:
|
70
|
+
build_after_unfurling(io: io, filename: filename, content_type: content_type, metadata: metadata, identify: identify).tap(&:save!)
|
71
|
+
end
|
72
|
+
|
73
|
+
# Creates a new blob instance and then uploads the contents of the given <tt>io</tt> to the
|
74
|
+
# service. The blob instance is saved before the upload begins to avoid clobbering another due
|
75
|
+
# to key collisions.
|
76
|
+
#
|
69
77
|
# When providing a content type, pass <tt>identify: false</tt> to bypass automatic content type inference.
|
70
|
-
def
|
71
|
-
|
78
|
+
def create_and_upload!(io:, filename:, content_type: nil, metadata: nil, identify: true, record: nil)
|
79
|
+
create_after_unfurling!(io: io, filename: filename, content_type: content_type, metadata: metadata, identify: identify).tap do |blob|
|
80
|
+
blob.upload_without_unfurling(io)
|
81
|
+
end
|
72
82
|
end
|
73
83
|
|
84
|
+
alias_method :create_after_upload!, :create_and_upload!
|
85
|
+
|
74
86
|
# Returns a saved blob _without_ uploading a file to the service. This blob will point to a key where there is
|
75
87
|
# no file yet. It's intended to be used together with a client-side upload, which will first create the blob
|
76
88
|
# in order to produce the signed URL for uploading. This signed URL points to the key generated by the blob.
|
@@ -165,8 +177,9 @@ class ActiveStorage::Blob < ActiveRecord::Base
|
|
165
177
|
# and store that in +byte_size+ on the blob record. The content type is automatically extracted from the +io+ unless
|
166
178
|
# you specify a +content_type+ and pass +identify+ as false.
|
167
179
|
#
|
168
|
-
# Normally, you do not have to call this method directly at all. Use the
|
169
|
-
#
|
180
|
+
# Normally, you do not have to call this method directly at all. Use the +create_and_upload!+ class method instead.
|
181
|
+
# If you do use this method directly, make sure you are using it on a persisted Blob as otherwise another blob's
|
182
|
+
# data might get overwritten on the service.
|
170
183
|
def upload(io, identify: true)
|
171
184
|
unfurl io, identify: identify
|
172
185
|
upload_without_unfurling io
|
@@ -193,17 +206,18 @@ class ActiveStorage::Blob < ActiveRecord::Base
|
|
193
206
|
#
|
194
207
|
# The tempfile's name is prefixed with +ActiveStorage-+ and the blob's ID. Its extension matches that of the blob.
|
195
208
|
#
|
196
|
-
# By default, the tempfile is created in <tt>Dir.tmpdir</tt>. Pass +
|
209
|
+
# By default, the tempfile is created in <tt>Dir.tmpdir</tt>. Pass +tmpdir:+ to create it in a different directory:
|
197
210
|
#
|
198
|
-
# blob.open(
|
211
|
+
# blob.open(tmpdir: "/path/to/tmp") do |file|
|
199
212
|
# # ...
|
200
213
|
# end
|
201
214
|
#
|
202
215
|
# The tempfile is automatically closed and unlinked after the given block is executed.
|
203
216
|
#
|
204
217
|
# Raises ActiveStorage::IntegrityError if the downloaded data does not match the blob's checksum.
|
205
|
-
def open(
|
206
|
-
|
218
|
+
def open(tmpdir: nil, &block)
|
219
|
+
service.open key, checksum: checksum,
|
220
|
+
name: [ "ActiveStorage-#{id}-", filename.extension_with_delimiter ], tmpdir: tmpdir, &block
|
207
221
|
end
|
208
222
|
|
209
223
|
|
@@ -272,6 +286,6 @@ class ActiveStorage::Blob < ActiveRecord::Base
|
|
272
286
|
{ content_type: content_type }
|
273
287
|
end
|
274
288
|
end
|
275
|
-
|
276
|
-
ActiveSupport.run_load_hooks(:active_storage_blob, self)
|
277
289
|
end
|
290
|
+
|
291
|
+
ActiveSupport.run_load_hooks :active_storage_blob, ActiveStorage::Blob
|
@@ -40,7 +40,7 @@ class ActiveStorage::Variation
|
|
40
40
|
end
|
41
41
|
|
42
42
|
def initialize(transformations)
|
43
|
-
@transformations = transformations
|
43
|
+
@transformations = transformations.deep_symbolize_keys
|
44
44
|
end
|
45
45
|
|
46
46
|
# Accepts a File object, performs the +transformations+ against it, and
|
@@ -64,7 +64,7 @@ class ActiveStorage::Variation
|
|
64
64
|
begin
|
65
65
|
require "image_processing"
|
66
66
|
rescue LoadError
|
67
|
-
ActiveSupport::Deprecation.warn <<~WARNING
|
67
|
+
ActiveSupport::Deprecation.warn <<~WARNING.squish
|
68
68
|
Generating image variants will require the image_processing gem in Rails 6.1.
|
69
69
|
Please add `gem 'image_processing', '~> 1.2'` to your Gemfile.
|
70
70
|
WARNING
|
@@ -1,6 +1,8 @@
|
|
1
1
|
class AddForeignKeyConstraintToActiveStorageAttachmentsForBlobId < ActiveRecord::Migration[6.0]
|
2
2
|
def up
|
3
|
-
|
3
|
+
return if foreign_key_exists?(:active_storage_attachments, column: :blob_id)
|
4
|
+
|
5
|
+
if table_exists?(:active_storage_blobs)
|
4
6
|
add_foreign_key :active_storage_attachments, :active_storage_blobs, column: :blob_id
|
5
7
|
end
|
6
8
|
end
|
data/lib/active_storage.rb
CHANGED
@@ -43,18 +43,26 @@ module ActiveStorage
|
|
43
43
|
|
44
44
|
mattr_accessor :logger
|
45
45
|
mattr_accessor :verifier
|
46
|
+
mattr_accessor :variant_processor, default: :mini_magick
|
47
|
+
|
46
48
|
mattr_accessor :queues, default: {}
|
49
|
+
|
47
50
|
mattr_accessor :previewers, default: []
|
48
|
-
mattr_accessor :analyzers,
|
49
|
-
|
51
|
+
mattr_accessor :analyzers, default: []
|
52
|
+
|
50
53
|
mattr_accessor :paths, default: {}
|
51
|
-
|
54
|
+
|
55
|
+
mattr_accessor :variable_content_types, default: []
|
56
|
+
mattr_accessor :binary_content_type, default: "application/octet-stream"
|
52
57
|
mattr_accessor :content_types_to_serve_as_binary, default: []
|
53
|
-
mattr_accessor :content_types_allowed_inline,
|
54
|
-
|
58
|
+
mattr_accessor :content_types_allowed_inline, default: []
|
59
|
+
|
55
60
|
mattr_accessor :service_urls_expire_in, default: 5.minutes
|
61
|
+
|
56
62
|
mattr_accessor :routes_prefix, default: "/rails/active_storage"
|
57
63
|
|
64
|
+
mattr_accessor :replace_on_assign_to_many, default: false
|
65
|
+
|
58
66
|
module Transformers
|
59
67
|
extend ActiveSupport::Autoload
|
60
68
|
|
@@ -24,14 +24,14 @@ module ActiveStorage
|
|
24
24
|
private
|
25
25
|
# Downloads the blob to a tempfile on disk. Yields the tempfile.
|
26
26
|
def download_blob_to_tempfile(&block) #:doc:
|
27
|
-
blob.open
|
27
|
+
blob.open tmpdir: tmpdir, &block
|
28
28
|
end
|
29
29
|
|
30
30
|
def logger #:doc:
|
31
31
|
ActiveStorage.logger
|
32
32
|
end
|
33
33
|
|
34
|
-
def
|
34
|
+
def tmpdir #:doc:
|
35
35
|
Dir.tmpdir
|
36
36
|
end
|
37
37
|
end
|
@@ -25,17 +25,24 @@ module ActiveStorage
|
|
25
25
|
{ width: image.width, height: image.height }
|
26
26
|
end
|
27
27
|
end
|
28
|
-
rescue LoadError
|
29
|
-
logger.info "Skipping image analysis because the mini_magick gem isn't installed"
|
30
|
-
{}
|
31
28
|
end
|
32
29
|
|
33
30
|
private
|
34
31
|
def read_image
|
35
32
|
download_blob_to_tempfile do |file|
|
36
33
|
require "mini_magick"
|
37
|
-
|
34
|
+
image = MiniMagick::Image.new(file.path)
|
35
|
+
|
36
|
+
if image.valid?
|
37
|
+
yield image
|
38
|
+
else
|
39
|
+
logger.info "Skipping image analysis because ImageMagick doesn't support the file"
|
40
|
+
{}
|
41
|
+
end
|
38
42
|
end
|
43
|
+
rescue LoadError
|
44
|
+
logger.info "Skipping image analysis because the mini_magick gem isn't installed"
|
45
|
+
{}
|
39
46
|
end
|
40
47
|
|
41
48
|
def rotated_image?(image)
|
@@ -31,7 +31,7 @@ module ActiveStorage
|
|
31
31
|
if record.persisted? && !record.changed?
|
32
32
|
record.update(name => blobs + attachables.flatten)
|
33
33
|
else
|
34
|
-
record.public_send("#{name}=", blobs + attachables.flatten)
|
34
|
+
record.public_send("#{name}=", (change&.attachables || blobs) + attachables.flatten)
|
35
35
|
end
|
36
36
|
end
|
37
37
|
|
@@ -93,12 +93,19 @@ module ActiveStorage
|
|
93
93
|
end
|
94
94
|
|
95
95
|
def #{name}=(attachables)
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
96
|
+
if ActiveStorage.replace_on_assign_to_many
|
97
|
+
attachment_changes["#{name}"] =
|
98
|
+
if Array(attachables).none?
|
99
|
+
ActiveStorage::Attached::Changes::DeleteMany.new("#{name}", self)
|
100
|
+
else
|
101
|
+
ActiveStorage::Attached::Changes::CreateMany.new("#{name}", self, attachables)
|
102
|
+
end
|
103
|
+
else
|
104
|
+
if Array(attachables).any?
|
105
|
+
attachment_changes["#{name}"] =
|
106
|
+
ActiveStorage::Attached::Changes::CreateMany.new("#{name}", self, #{name}.blobs + attachables)
|
101
107
|
end
|
108
|
+
end
|
102
109
|
end
|
103
110
|
CODE
|
104
111
|
|
@@ -2,24 +2,23 @@
|
|
2
2
|
|
3
3
|
module ActiveStorage
|
4
4
|
class Downloader #:nodoc:
|
5
|
-
|
6
|
-
|
7
|
-
|
5
|
+
attr_reader :service
|
6
|
+
|
7
|
+
def initialize(service)
|
8
|
+
@service = service
|
8
9
|
end
|
9
10
|
|
10
|
-
def
|
11
|
-
open_tempfile do |file|
|
12
|
-
|
13
|
-
verify_integrity_of file
|
11
|
+
def open(key, checksum:, name: "ActiveStorage-", tmpdir: nil)
|
12
|
+
open_tempfile(name, tmpdir) do |file|
|
13
|
+
download key, file
|
14
|
+
verify_integrity_of file, checksum: checksum
|
14
15
|
yield file
|
15
16
|
end
|
16
17
|
end
|
17
18
|
|
18
19
|
private
|
19
|
-
|
20
|
-
|
21
|
-
def open_tempfile
|
22
|
-
file = Tempfile.open([ "ActiveStorage-#{blob.id}-", blob.filename.extension_with_delimiter ], tempdir)
|
20
|
+
def open_tempfile(name, tmpdir = nil)
|
21
|
+
file = Tempfile.open(name, tmpdir)
|
23
22
|
|
24
23
|
begin
|
25
24
|
yield file
|
@@ -28,15 +27,15 @@ module ActiveStorage
|
|
28
27
|
end
|
29
28
|
end
|
30
29
|
|
31
|
-
def
|
30
|
+
def download(key, file)
|
32
31
|
file.binmode
|
33
|
-
|
32
|
+
service.download(key) { |chunk| file.write(chunk) }
|
34
33
|
file.flush
|
35
34
|
file.rewind
|
36
35
|
end
|
37
36
|
|
38
|
-
def verify_integrity_of(file)
|
39
|
-
unless Digest::MD5.file(file).base64digest ==
|
37
|
+
def verify_integrity_of(file, checksum:)
|
38
|
+
unless Digest::MD5.file(file).base64digest == checksum
|
40
39
|
raise ActiveStorage::IntegrityError
|
41
40
|
end
|
42
41
|
end
|
@@ -1,6 +1,10 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
require "rails"
|
4
|
+
require "action_controller/railtie"
|
5
|
+
require "active_job/railtie"
|
6
|
+
require "active_record/railtie"
|
7
|
+
|
4
8
|
require "active_storage"
|
5
9
|
|
6
10
|
require "active_storage/previewer/poppler_pdf_previewer"
|
@@ -29,6 +33,7 @@ module ActiveStorage
|
|
29
33
|
image/jpeg
|
30
34
|
image/pjpeg
|
31
35
|
image/tiff
|
36
|
+
image/bmp
|
32
37
|
image/vnd.adobe.photoshop
|
33
38
|
image/vnd.microsoft.icon
|
34
39
|
)
|
@@ -52,6 +57,7 @@ module ActiveStorage
|
|
52
57
|
image/jpg
|
53
58
|
image/jpeg
|
54
59
|
image/tiff
|
60
|
+
image/bmp
|
55
61
|
image/vnd.adobe.photoshop
|
56
62
|
image/vnd.microsoft.icon
|
57
63
|
application/pdf
|
@@ -73,6 +79,8 @@ module ActiveStorage
|
|
73
79
|
ActiveStorage.service_urls_expire_in = app.config.active_storage.service_urls_expire_in || 5.minutes
|
74
80
|
ActiveStorage.content_types_allowed_inline = app.config.active_storage.content_types_allowed_inline || []
|
75
81
|
ActiveStorage.binary_content_type = app.config.active_storage.binary_content_type || "application/octet-stream"
|
82
|
+
|
83
|
+
ActiveStorage.replace_on_assign_to_many = app.config.active_storage.replace_on_assign_to_many || false
|
76
84
|
end
|
77
85
|
end
|
78
86
|
|
@@ -26,7 +26,7 @@ module ActiveStorage
|
|
26
26
|
private
|
27
27
|
# Downloads the blob to a tempfile on disk. Yields the tempfile.
|
28
28
|
def download_blob_to_tempfile(&block) #:doc:
|
29
|
-
blob.open
|
29
|
+
blob.open tmpdir: tmpdir, &block
|
30
30
|
end
|
31
31
|
|
32
32
|
# Executes a system command, capturing its binary output in a tempfile. Yields the tempfile.
|
@@ -42,7 +42,7 @@ module ActiveStorage
|
|
42
42
|
# end
|
43
43
|
# end
|
44
44
|
#
|
45
|
-
# The output tempfile is opened in the directory returned by #
|
45
|
+
# The output tempfile is opened in the directory returned by #tmpdir.
|
46
46
|
def draw(*argv) #:doc:
|
47
47
|
open_tempfile do |file|
|
48
48
|
instrument :preview, key: blob.key do
|
@@ -54,7 +54,7 @@ module ActiveStorage
|
|
54
54
|
end
|
55
55
|
|
56
56
|
def open_tempfile
|
57
|
-
tempfile = Tempfile.open("ActiveStorage-",
|
57
|
+
tempfile = Tempfile.open("ActiveStorage-", tmpdir)
|
58
58
|
|
59
59
|
begin
|
60
60
|
yield tempfile
|
@@ -77,7 +77,7 @@ module ActiveStorage
|
|
77
77
|
ActiveStorage.logger
|
78
78
|
end
|
79
79
|
|
80
|
-
def
|
80
|
+
def tmpdir #:doc:
|
81
81
|
Dir.tmpdir
|
82
82
|
end
|
83
83
|
end
|
@@ -84,8 +84,12 @@ module ActiveStorage
|
|
84
84
|
purpose: :blob_key }
|
85
85
|
)
|
86
86
|
|
87
|
+
current_uri = URI.parse(current_host)
|
88
|
+
|
87
89
|
generated_url = url_helpers.rails_disk_service_url(verified_key_with_expiration,
|
88
|
-
|
90
|
+
protocol: current_uri.scheme,
|
91
|
+
host: current_uri.host,
|
92
|
+
port: current_uri.port,
|
89
93
|
disposition: content_disposition,
|
90
94
|
content_type: content_type,
|
91
95
|
filename: filename
|
@@ -22,7 +22,7 @@ module ActiveStorage
|
|
22
22
|
def operations
|
23
23
|
transformations.each_with_object([]) do |(name, argument), list|
|
24
24
|
if name.to_s == "combine_options"
|
25
|
-
ActiveSupport::Deprecation.warn <<~WARNING
|
25
|
+
ActiveSupport::Deprecation.warn <<~WARNING.squish
|
26
26
|
Active Storage's ImageProcessing transformer doesn't support :combine_options,
|
27
27
|
as it always generates a single ImageMagick command. Passing :combine_options will
|
28
28
|
not be supported in Rails 6.1.
|
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.2.rc2
|
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: 2019-
|
11
|
+
date: 2019-12-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: actionpack
|
@@ -16,28 +16,42 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - '='
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 6.0.
|
19
|
+
version: 6.0.2.rc2
|
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.2.rc2
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: activejob
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - '='
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: 6.0.2.rc2
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - '='
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: 6.0.2.rc2
|
27
41
|
- !ruby/object:Gem::Dependency
|
28
42
|
name: activerecord
|
29
43
|
requirement: !ruby/object:Gem::Requirement
|
30
44
|
requirements:
|
31
45
|
- - '='
|
32
46
|
- !ruby/object:Gem::Version
|
33
|
-
version: 6.0.
|
47
|
+
version: 6.0.2.rc2
|
34
48
|
type: :runtime
|
35
49
|
prerelease: false
|
36
50
|
version_requirements: !ruby/object:Gem::Requirement
|
37
51
|
requirements:
|
38
52
|
- - '='
|
39
53
|
- !ruby/object:Gem::Version
|
40
|
-
version: 6.0.
|
54
|
+
version: 6.0.2.rc2
|
41
55
|
- !ruby/object:Gem::Dependency
|
42
56
|
name: marcel
|
43
57
|
requirement: !ruby/object:Gem::Requirement
|
@@ -132,12 +146,15 @@ files:
|
|
132
146
|
- lib/active_storage/transformers/transformer.rb
|
133
147
|
- lib/active_storage/version.rb
|
134
148
|
- lib/tasks/activestorage.rake
|
135
|
-
homepage:
|
149
|
+
homepage: https://rubyonrails.org
|
136
150
|
licenses:
|
137
151
|
- MIT
|
138
152
|
metadata:
|
139
|
-
|
140
|
-
changelog_uri: https://github.com/rails/rails/blob/v6.0.
|
153
|
+
bug_tracker_uri: https://github.com/rails/rails/issues
|
154
|
+
changelog_uri: https://github.com/rails/rails/blob/v6.0.2.rc2/activestorage/CHANGELOG.md
|
155
|
+
documentation_uri: https://api.rubyonrails.org/v6.0.2.rc2/
|
156
|
+
mailing_list_uri: https://groups.google.com/forum/#!forum/rubyonrails-talk
|
157
|
+
source_code_uri: https://github.com/rails/rails/tree/v6.0.2.rc2/activestorage
|
141
158
|
post_install_message:
|
142
159
|
rdoc_options: []
|
143
160
|
require_paths:
|
@@ -153,7 +170,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
153
170
|
- !ruby/object:Gem::Version
|
154
171
|
version: 1.3.1
|
155
172
|
requirements: []
|
156
|
-
rubygems_version: 3.0.
|
173
|
+
rubygems_version: 3.0.3
|
157
174
|
signing_key:
|
158
175
|
specification_version: 4
|
159
176
|
summary: Local and cloud file storage framework.
|