activestorage 7.0.10 → 7.1.0.beta1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of activestorage might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/CHANGELOG.md +123 -381
- data/MIT-LICENSE +1 -1
- data/README.md +5 -5
- 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/transform_job.rb +12 -0
- data/app/models/active_storage/attachment.rb +87 -13
- 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.rb +44 -50
- 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 +6 -8
- data/app/models/active_storage/variant.rb +8 -3
- data/app/models/active_storage/variant_with_record.rb +16 -11
- data/app/models/active_storage/variation.rb +5 -3
- 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 +14 -2
- data/lib/active_storage/attached/many.rb +5 -4
- data/lib/active_storage/attached/model.rb +59 -42
- 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 +2 -4
- data/lib/active_storage/gem_version.rb +4 -4
- 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 +22 -31
- data/app/models/active_storage/blob/servable.rb +0 -22
|
@@ -9,34 +9,46 @@ module ActiveStorage
|
|
|
9
9
|
message += " (checksum: #{event.payload[:checksum]})" if event.payload[:checksum]
|
|
10
10
|
info event, color(message, GREEN)
|
|
11
11
|
end
|
|
12
|
+
subscribe_log_level :service_upload, :info
|
|
12
13
|
|
|
13
14
|
def service_download(event)
|
|
14
15
|
info event, color("Downloaded file from key: #{key_in(event)}", BLUE)
|
|
15
16
|
end
|
|
17
|
+
subscribe_log_level :service_download, :info
|
|
16
18
|
|
|
17
19
|
alias_method :service_streaming_download, :service_download
|
|
18
20
|
|
|
21
|
+
def preview(event)
|
|
22
|
+
info event, color("Previewed file from key: #{key_in(event)}", BLUE)
|
|
23
|
+
end
|
|
24
|
+
subscribe_log_level :preview, :info
|
|
25
|
+
|
|
19
26
|
def service_delete(event)
|
|
20
27
|
info event, color("Deleted file from key: #{key_in(event)}", RED)
|
|
21
28
|
end
|
|
29
|
+
subscribe_log_level :service_delete, :info
|
|
22
30
|
|
|
23
31
|
def service_delete_prefixed(event)
|
|
24
32
|
info event, color("Deleted files by key prefix: #{event.payload[:prefix]}", RED)
|
|
25
33
|
end
|
|
34
|
+
subscribe_log_level :service_delete_prefixed, :info
|
|
26
35
|
|
|
27
36
|
def service_exist(event)
|
|
28
37
|
debug event, color("Checked if file exists at key: #{key_in(event)} (#{event.payload[:exist] ? "yes" : "no"})", BLUE)
|
|
29
38
|
end
|
|
39
|
+
subscribe_log_level :service_exist, :debug
|
|
30
40
|
|
|
31
41
|
def service_url(event)
|
|
32
42
|
debug event, color("Generated URL for file at key: #{key_in(event)} (#{event.payload[:url]})", BLUE)
|
|
33
43
|
end
|
|
44
|
+
subscribe_log_level :service_url, :debug
|
|
34
45
|
|
|
35
46
|
def service_mirror(event)
|
|
36
47
|
message = "Mirrored file at key: #{key_in(event)}"
|
|
37
48
|
message += " (checksum: #{event.payload[:checksum]})" if event.payload[:checksum]
|
|
38
49
|
debug event, color(message, GREEN)
|
|
39
50
|
end
|
|
51
|
+
subscribe_log_level :service_mirror, :debug
|
|
40
52
|
|
|
41
53
|
def logger
|
|
42
54
|
ActiveStorage.logger
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
3
|
module ActiveStorage
|
|
4
|
+
# = Active Storage \Previewer
|
|
5
|
+
#
|
|
4
6
|
# This is an abstract base class for previewers, which generate images from blobs. See
|
|
5
7
|
# ActiveStorage::Previewer::MuPDFPreviewer and ActiveStorage::Previewer::VideoPreviewer for
|
|
6
8
|
# examples of concrete subclasses.
|
|
@@ -65,7 +67,12 @@ module ActiveStorage
|
|
|
65
67
|
end
|
|
66
68
|
|
|
67
69
|
def instrument(operation, payload = {}, &block)
|
|
68
|
-
ActiveSupport::Notifications.instrument "#{operation}.active_storage", payload, &block
|
|
70
|
+
ActiveSupport::Notifications.instrument "#{operation}.active_storage", payload.merge(service: service_name), &block
|
|
71
|
+
end
|
|
72
|
+
|
|
73
|
+
def service_name
|
|
74
|
+
# ActiveStorage::Service::DiskService => Disk
|
|
75
|
+
blob.service.class.to_s.split("::").third.remove("Service")
|
|
69
76
|
end
|
|
70
77
|
|
|
71
78
|
def capture(*argv, to:)
|
|
@@ -4,11 +4,11 @@ module ActiveStorage
|
|
|
4
4
|
module Reflection
|
|
5
5
|
class HasAttachedReflection < ActiveRecord::Reflection::MacroReflection # :nodoc:
|
|
6
6
|
def variant(name, transformations)
|
|
7
|
-
|
|
7
|
+
named_variants[name] = NamedVariant.new(transformations)
|
|
8
8
|
end
|
|
9
9
|
|
|
10
|
-
def
|
|
11
|
-
@
|
|
10
|
+
def named_variants
|
|
11
|
+
@named_variants ||= {}
|
|
12
12
|
end
|
|
13
13
|
end
|
|
14
14
|
|
|
@@ -7,6 +7,8 @@ require "azure/storage/blob"
|
|
|
7
7
|
require "azure/storage/common/core/auth/shared_access_signature"
|
|
8
8
|
|
|
9
9
|
module ActiveStorage
|
|
10
|
+
# = Active Storage \Azure Storage \Service
|
|
11
|
+
#
|
|
10
12
|
# Wraps the Microsoft Azure Storage Blob Service as an Active Storage service.
|
|
11
13
|
# See ActiveStorage::Service for the generic API documentation that applies to all services.
|
|
12
14
|
class Service::AzureStorageService < Service
|
|
@@ -6,6 +6,8 @@ require "openssl"
|
|
|
6
6
|
require "active_support/core_ext/numeric/bytes"
|
|
7
7
|
|
|
8
8
|
module ActiveStorage
|
|
9
|
+
# = Active Storage \Disk \Service
|
|
10
|
+
#
|
|
9
11
|
# Wraps a local disk path as an Active Storage service. See ActiveStorage::Service for the generic API
|
|
10
12
|
# documentation that applies to all services.
|
|
11
13
|
class Service::DiskService < Service
|
|
@@ -5,6 +5,8 @@ require "google/apis/iamcredentials_v1"
|
|
|
5
5
|
require "google/cloud/storage"
|
|
6
6
|
|
|
7
7
|
module ActiveStorage
|
|
8
|
+
# = Active Storage \GCS \Service
|
|
9
|
+
#
|
|
8
10
|
# Wraps the Google Cloud Storage as an Active Storage service. See ActiveStorage::Service for the generic API
|
|
9
11
|
# documentation that applies to all services.
|
|
10
12
|
class Service::GCSService < Service
|
|
@@ -195,26 +197,15 @@ module ActiveStorage
|
|
|
195
197
|
end
|
|
196
198
|
|
|
197
199
|
def issuer
|
|
198
|
-
@issuer ||=
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
response = http.request(request)
|
|
208
|
-
rescue SocketError
|
|
209
|
-
raise MetadataServerNotFoundError
|
|
210
|
-
end
|
|
211
|
-
|
|
212
|
-
if response.is_a?(Net::HTTPSuccess)
|
|
213
|
-
response.body
|
|
214
|
-
else
|
|
215
|
-
raise MetadataServerError
|
|
216
|
-
end
|
|
217
|
-
end
|
|
200
|
+
@issuer ||= @config[:gsa_email].presence || email_from_metadata_server
|
|
201
|
+
end
|
|
202
|
+
|
|
203
|
+
def email_from_metadata_server
|
|
204
|
+
env = Google::Cloud.env
|
|
205
|
+
raise MetadataServerNotFoundError if !env.metadata?
|
|
206
|
+
|
|
207
|
+
email = env.lookup_metadata("instance", "service-accounts/default/email")
|
|
208
|
+
email.presence or raise MetadataServerError
|
|
218
209
|
end
|
|
219
210
|
|
|
220
211
|
def signer
|
|
@@ -3,6 +3,8 @@
|
|
|
3
3
|
require "active_support/core_ext/module/delegation"
|
|
4
4
|
|
|
5
5
|
module ActiveStorage
|
|
6
|
+
# = Active Storage Mirror \Service
|
|
7
|
+
#
|
|
6
8
|
# Wraps a set of mirror services and provides a single ActiveStorage::Service object that will all
|
|
7
9
|
# have the files uploaded to them. A +primary+ service is designated to answer calls to:
|
|
8
10
|
# * +download+
|
|
@@ -30,13 +32,13 @@ module ActiveStorage
|
|
|
30
32
|
@primary, @mirrors = primary, mirrors
|
|
31
33
|
end
|
|
32
34
|
|
|
33
|
-
# Upload the +io+ to the +key+ specified to all services.
|
|
35
|
+
# Upload the +io+ to the +key+ specified to all services. The upload to the primary service is done synchronously
|
|
36
|
+
# whereas the upload to the mirrors is done asynchronously. If a +checksum+ is provided, all services will
|
|
34
37
|
# ensure a match when the upload has completed or raise an ActiveStorage::IntegrityError.
|
|
35
38
|
def upload(key, io, checksum: nil, **options)
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
end
|
|
39
|
+
io.rewind
|
|
40
|
+
primary.upload key, io, checksum: checksum, **options
|
|
41
|
+
mirror_later key, checksum: checksum
|
|
40
42
|
end
|
|
41
43
|
|
|
42
44
|
# Delete the file at the +key+ on all services.
|
|
@@ -49,6 +51,9 @@ module ActiveStorage
|
|
|
49
51
|
perform_across_services :delete_prefixed, prefix
|
|
50
52
|
end
|
|
51
53
|
|
|
54
|
+
def mirror_later(key, checksum:) # :nodoc:
|
|
55
|
+
ActiveStorage::MirrorJob.perform_later key, checksum: checksum
|
|
56
|
+
end
|
|
52
57
|
|
|
53
58
|
# Copy the file at the +key+ from the primary service to each of the mirrors where it doesn't already exist.
|
|
54
59
|
def mirror(key, checksum:)
|
|
@@ -6,6 +6,8 @@ require "aws-sdk-s3"
|
|
|
6
6
|
require "active_support/core_ext/numeric/bytes"
|
|
7
7
|
|
|
8
8
|
module ActiveStorage
|
|
9
|
+
# = Active Storage \S3 \Service
|
|
10
|
+
#
|
|
9
11
|
# Wraps the Amazon Simple Storage Service (S3) as an Active Storage service.
|
|
10
12
|
# See ActiveStorage::Service for the generic API documentation that applies to all services.
|
|
11
13
|
class Service::S3Service < Service
|
|
@@ -6,6 +6,8 @@ require "action_dispatch"
|
|
|
6
6
|
require "action_dispatch/http/content_disposition"
|
|
7
7
|
|
|
8
8
|
module ActiveStorage
|
|
9
|
+
# = Active Storage \Service
|
|
10
|
+
#
|
|
9
11
|
# Abstract class serving as an interface for concrete services.
|
|
10
12
|
#
|
|
11
13
|
# The available services are:
|
|
@@ -16,7 +18,7 @@ module ActiveStorage
|
|
|
16
18
|
# * +AzureStorage+, to manage attachments through Microsoft Azure Storage.
|
|
17
19
|
# * +Mirror+, to be able to use several services to manage attachments.
|
|
18
20
|
#
|
|
19
|
-
# Inside a Rails application, you can set-up your services through the
|
|
21
|
+
# Inside a \Rails application, you can set-up your services through the
|
|
20
22
|
# generated <tt>config/storage.yml</tt> file and reference one
|
|
21
23
|
# of the aforementioned constant under the +service+ key. For example:
|
|
22
24
|
#
|
|
@@ -31,7 +33,7 @@ module ActiveStorage
|
|
|
31
33
|
#
|
|
32
34
|
# config.active_storage.service = :local
|
|
33
35
|
#
|
|
34
|
-
# If you are using Active Storage outside of a Ruby on Rails application, you
|
|
36
|
+
# If you are using Active Storage outside of a Ruby on \Rails application, you
|
|
35
37
|
# can configure the service to use like this:
|
|
36
38
|
#
|
|
37
39
|
# ActiveStorage::Blob.service = ActiveStorage::Service.configure(
|
data/lib/active_storage.rb
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
3
|
#--
|
|
4
|
-
# Copyright (c)
|
|
4
|
+
# Copyright (c) David Heinemeier Hansson, 37signals LLC
|
|
5
5
|
#
|
|
6
6
|
# Permission is hereby granted, free of charge, to any person obtaining
|
|
7
7
|
# a copy of this software and associated documentation files (the
|
|
@@ -29,10 +29,13 @@ require "active_support/rails"
|
|
|
29
29
|
require "active_support/core_ext/numeric/time"
|
|
30
30
|
|
|
31
31
|
require "active_storage/version"
|
|
32
|
+
require "active_storage/deprecator"
|
|
32
33
|
require "active_storage/errors"
|
|
33
34
|
|
|
34
35
|
require "marcel"
|
|
35
36
|
|
|
37
|
+
# :markup: markdown
|
|
38
|
+
# :include: activestorage/README.md
|
|
36
39
|
module ActiveStorage
|
|
37
40
|
extend ActiveSupport::Autoload
|
|
38
41
|
|
|
@@ -357,12 +360,25 @@ module ActiveStorage
|
|
|
357
360
|
mattr_accessor :draw_routes, default: true
|
|
358
361
|
mattr_accessor :resolve_model_to_route, default: :rails_storage_redirect
|
|
359
362
|
|
|
360
|
-
mattr_accessor :replace_on_assign_to_many, default: false
|
|
361
363
|
mattr_accessor :track_variants, default: false
|
|
362
364
|
|
|
363
365
|
mattr_accessor :video_preview_arguments, default: "-y -vframes 1 -f image2"
|
|
364
366
|
|
|
365
|
-
|
|
367
|
+
def self.replace_on_assign_to_many
|
|
368
|
+
ActiveStorage.deprecator.warn("config.active_storage.replace_on_assign_to_many is deprecated and has no effect.")
|
|
369
|
+
end
|
|
370
|
+
|
|
371
|
+
def self.replace_on_assign_to_many=(value)
|
|
372
|
+
ActiveStorage.deprecator.warn("config.active_storage.replace_on_assign_to_many is deprecated and has no effect.")
|
|
373
|
+
end
|
|
374
|
+
|
|
375
|
+
def self.silence_invalid_content_types_warning
|
|
376
|
+
ActiveStorage.deprecator.warn("config.active_storage.silence_invalid_content_types_warning is deprecated and has no effect.")
|
|
377
|
+
end
|
|
378
|
+
|
|
379
|
+
def self.silence_invalid_content_types_warning=(value)
|
|
380
|
+
ActiveStorage.deprecator.warn("config.active_storage.silence_invalid_content_types_warning is deprecated and has no effect.")
|
|
381
|
+
end
|
|
366
382
|
|
|
367
383
|
module Transformers
|
|
368
384
|
extend ActiveSupport::Autoload
|
metadata
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: activestorage
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 7.0.
|
|
4
|
+
version: 7.1.0.beta1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- David Heinemeier Hansson
|
|
8
|
+
autorequire:
|
|
8
9
|
bindir: bin
|
|
9
10
|
cert_chain: []
|
|
10
|
-
date:
|
|
11
|
+
date: 2023-09-13 00:00:00.000000000 Z
|
|
11
12
|
dependencies:
|
|
12
13
|
- !ruby/object:Gem::Dependency
|
|
13
14
|
name: activesupport
|
|
@@ -15,56 +16,56 @@ dependencies:
|
|
|
15
16
|
requirements:
|
|
16
17
|
- - '='
|
|
17
18
|
- !ruby/object:Gem::Version
|
|
18
|
-
version: 7.0.
|
|
19
|
+
version: 7.1.0.beta1
|
|
19
20
|
type: :runtime
|
|
20
21
|
prerelease: false
|
|
21
22
|
version_requirements: !ruby/object:Gem::Requirement
|
|
22
23
|
requirements:
|
|
23
24
|
- - '='
|
|
24
25
|
- !ruby/object:Gem::Version
|
|
25
|
-
version: 7.0.
|
|
26
|
+
version: 7.1.0.beta1
|
|
26
27
|
- !ruby/object:Gem::Dependency
|
|
27
28
|
name: actionpack
|
|
28
29
|
requirement: !ruby/object:Gem::Requirement
|
|
29
30
|
requirements:
|
|
30
31
|
- - '='
|
|
31
32
|
- !ruby/object:Gem::Version
|
|
32
|
-
version: 7.0.
|
|
33
|
+
version: 7.1.0.beta1
|
|
33
34
|
type: :runtime
|
|
34
35
|
prerelease: false
|
|
35
36
|
version_requirements: !ruby/object:Gem::Requirement
|
|
36
37
|
requirements:
|
|
37
38
|
- - '='
|
|
38
39
|
- !ruby/object:Gem::Version
|
|
39
|
-
version: 7.0.
|
|
40
|
+
version: 7.1.0.beta1
|
|
40
41
|
- !ruby/object:Gem::Dependency
|
|
41
42
|
name: activejob
|
|
42
43
|
requirement: !ruby/object:Gem::Requirement
|
|
43
44
|
requirements:
|
|
44
45
|
- - '='
|
|
45
46
|
- !ruby/object:Gem::Version
|
|
46
|
-
version: 7.0.
|
|
47
|
+
version: 7.1.0.beta1
|
|
47
48
|
type: :runtime
|
|
48
49
|
prerelease: false
|
|
49
50
|
version_requirements: !ruby/object:Gem::Requirement
|
|
50
51
|
requirements:
|
|
51
52
|
- - '='
|
|
52
53
|
- !ruby/object:Gem::Version
|
|
53
|
-
version: 7.0.
|
|
54
|
+
version: 7.1.0.beta1
|
|
54
55
|
- !ruby/object:Gem::Dependency
|
|
55
56
|
name: activerecord
|
|
56
57
|
requirement: !ruby/object:Gem::Requirement
|
|
57
58
|
requirements:
|
|
58
59
|
- - '='
|
|
59
60
|
- !ruby/object:Gem::Version
|
|
60
|
-
version: 7.0.
|
|
61
|
+
version: 7.1.0.beta1
|
|
61
62
|
type: :runtime
|
|
62
63
|
prerelease: false
|
|
63
64
|
version_requirements: !ruby/object:Gem::Requirement
|
|
64
65
|
requirements:
|
|
65
66
|
- - '='
|
|
66
67
|
- !ruby/object:Gem::Version
|
|
67
|
-
version: 7.0.
|
|
68
|
+
version: 7.1.0.beta1
|
|
68
69
|
- !ruby/object:Gem::Dependency
|
|
69
70
|
name: marcel
|
|
70
71
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -79,20 +80,6 @@ dependencies:
|
|
|
79
80
|
- - "~>"
|
|
80
81
|
- !ruby/object:Gem::Version
|
|
81
82
|
version: '1.0'
|
|
82
|
-
- !ruby/object:Gem::Dependency
|
|
83
|
-
name: mini_mime
|
|
84
|
-
requirement: !ruby/object:Gem::Requirement
|
|
85
|
-
requirements:
|
|
86
|
-
- - ">="
|
|
87
|
-
- !ruby/object:Gem::Version
|
|
88
|
-
version: 1.1.0
|
|
89
|
-
type: :runtime
|
|
90
|
-
prerelease: false
|
|
91
|
-
version_requirements: !ruby/object:Gem::Requirement
|
|
92
|
-
requirements:
|
|
93
|
-
- - ">="
|
|
94
|
-
- !ruby/object:Gem::Version
|
|
95
|
-
version: 1.1.0
|
|
96
83
|
description: Attach cloud and local files in Rails applications.
|
|
97
84
|
email: david@loudthinking.com
|
|
98
85
|
executables: []
|
|
@@ -130,14 +117,15 @@ files:
|
|
|
130
117
|
- app/jobs/active_storage/base_job.rb
|
|
131
118
|
- app/jobs/active_storage/mirror_job.rb
|
|
132
119
|
- app/jobs/active_storage/purge_job.rb
|
|
120
|
+
- app/jobs/active_storage/transform_job.rb
|
|
133
121
|
- app/models/active_storage/attachment.rb
|
|
134
122
|
- app/models/active_storage/blob.rb
|
|
135
123
|
- app/models/active_storage/blob/analyzable.rb
|
|
136
124
|
- app/models/active_storage/blob/identifiable.rb
|
|
137
125
|
- app/models/active_storage/blob/representable.rb
|
|
138
|
-
- app/models/active_storage/blob/servable.rb
|
|
139
126
|
- app/models/active_storage/current.rb
|
|
140
127
|
- app/models/active_storage/filename.rb
|
|
128
|
+
- app/models/active_storage/named_variant.rb
|
|
141
129
|
- app/models/active_storage/preview.rb
|
|
142
130
|
- app/models/active_storage/record.rb
|
|
143
131
|
- app/models/active_storage/variant.rb
|
|
@@ -171,6 +159,7 @@ files:
|
|
|
171
159
|
- lib/active_storage/attached/many.rb
|
|
172
160
|
- lib/active_storage/attached/model.rb
|
|
173
161
|
- lib/active_storage/attached/one.rb
|
|
162
|
+
- lib/active_storage/deprecator.rb
|
|
174
163
|
- lib/active_storage/downloader.rb
|
|
175
164
|
- lib/active_storage/engine.rb
|
|
176
165
|
- lib/active_storage/errors.rb
|
|
@@ -199,11 +188,12 @@ licenses:
|
|
|
199
188
|
- MIT
|
|
200
189
|
metadata:
|
|
201
190
|
bug_tracker_uri: https://github.com/rails/rails/issues
|
|
202
|
-
changelog_uri: https://github.com/rails/rails/blob/v7.0.
|
|
203
|
-
documentation_uri: https://api.rubyonrails.org/v7.0.
|
|
191
|
+
changelog_uri: https://github.com/rails/rails/blob/v7.1.0.beta1/activestorage/CHANGELOG.md
|
|
192
|
+
documentation_uri: https://api.rubyonrails.org/v7.1.0.beta1/
|
|
204
193
|
mailing_list_uri: https://discuss.rubyonrails.org/c/rubyonrails-talk
|
|
205
|
-
source_code_uri: https://github.com/rails/rails/tree/v7.0.
|
|
194
|
+
source_code_uri: https://github.com/rails/rails/tree/v7.1.0.beta1/activestorage
|
|
206
195
|
rubygems_mfa_required: 'true'
|
|
196
|
+
post_install_message:
|
|
207
197
|
rdoc_options: []
|
|
208
198
|
require_paths:
|
|
209
199
|
- lib
|
|
@@ -214,11 +204,12 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
|
214
204
|
version: 2.7.0
|
|
215
205
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
216
206
|
requirements:
|
|
217
|
-
- - "
|
|
207
|
+
- - ">"
|
|
218
208
|
- !ruby/object:Gem::Version
|
|
219
|
-
version:
|
|
209
|
+
version: 1.3.1
|
|
220
210
|
requirements: []
|
|
221
|
-
rubygems_version: 3.
|
|
211
|
+
rubygems_version: 3.4.18
|
|
212
|
+
signing_key:
|
|
222
213
|
specification_version: 4
|
|
223
214
|
summary: Local and cloud file storage framework.
|
|
224
215
|
test_files: []
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
module ActiveStorage::Blob::Servable # :nodoc:
|
|
4
|
-
def content_type_for_serving
|
|
5
|
-
forcibly_serve_as_binary? ? ActiveStorage.binary_content_type : content_type
|
|
6
|
-
end
|
|
7
|
-
|
|
8
|
-
def forced_disposition_for_serving
|
|
9
|
-
if forcibly_serve_as_binary? || !allowed_inline?
|
|
10
|
-
:attachment
|
|
11
|
-
end
|
|
12
|
-
end
|
|
13
|
-
|
|
14
|
-
private
|
|
15
|
-
def forcibly_serve_as_binary?
|
|
16
|
-
ActiveStorage.content_types_to_serve_as_binary.include?(content_type)
|
|
17
|
-
end
|
|
18
|
-
|
|
19
|
-
def allowed_inline?
|
|
20
|
-
ActiveStorage.content_types_allowed_inline.include?(content_type)
|
|
21
|
-
end
|
|
22
|
-
end
|