activestorage 7.1.3.4 → 7.1.5.1
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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +27 -0
- data/app/jobs/active_storage/preview_image_job.rb +16 -0
- data/app/models/active_storage/attachment.rb +12 -2
- data/app/models/active_storage/blob/representable.rb +8 -0
- data/lib/active_storage/attached/model.rb +8 -4
- data/lib/active_storage/gem_version.rb +2 -2
- data/lib/active_storage.rb +1 -1
- metadata +18 -17
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 206c165931991ed4701825d28d46e636a5a9aa38ff25d196f14906246d95c557
|
4
|
+
data.tar.gz: de61985ef1a441eeb98646f9f0231693ee3142f3d9c9793fd7e38678e08686c7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fed89deed587674a3ea944cc1a02f8bb09c698409cc724cc1e127cf704b7ec777f45682eb88b6f455b251ceb576be00f0504c65086b0727af65cd70f1648bf0e
|
7
|
+
data.tar.gz: 678cfe23e61e1a46039cbfedb20777103203e1fdba5455a47f49ba8e21a18d2887882d1eb85d7151af4424e04da4334eee3b0b7de198dedbde73597f378899ad
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,30 @@
|
|
1
|
+
## Rails 7.1.5.1 (December 10, 2024) ##
|
2
|
+
|
3
|
+
* No changes.
|
4
|
+
|
5
|
+
|
6
|
+
## Rails 7.1.5 (October 30, 2024) ##
|
7
|
+
|
8
|
+
* No changes.
|
9
|
+
|
10
|
+
|
11
|
+
## Rails 7.1.4.2 (October 23, 2024) ##
|
12
|
+
|
13
|
+
* No changes.
|
14
|
+
|
15
|
+
|
16
|
+
## Rails 7.1.4.1 (October 15, 2024) ##
|
17
|
+
|
18
|
+
* No changes.
|
19
|
+
|
20
|
+
|
21
|
+
## Rails 7.1.4 (August 22, 2024) ##
|
22
|
+
|
23
|
+
* Fixes race condition for multiple preprocessed video variants.
|
24
|
+
|
25
|
+
*Justin Searls*
|
26
|
+
|
27
|
+
|
1
28
|
## Rails 7.1.3.4 (June 04, 2024) ##
|
2
29
|
|
3
30
|
* No changes.
|
@@ -0,0 +1,16 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
class ActiveStorage::PreviewImageJob < ActiveStorage::BaseJob
|
4
|
+
queue_as { ActiveStorage.queues[:preview_image] }
|
5
|
+
|
6
|
+
discard_on ActiveRecord::RecordNotFound, ActiveStorage::UnrepresentableError
|
7
|
+
retry_on ActiveStorage::IntegrityError, attempts: 10, wait: :polynomially_longer
|
8
|
+
|
9
|
+
def perform(blob, variations)
|
10
|
+
blob.preview({}).processed
|
11
|
+
|
12
|
+
variations.each do |transformations|
|
13
|
+
blob.preprocessed(transformations)
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
@@ -132,8 +132,18 @@ class ActiveStorage::Attachment < ActiveStorage::Record
|
|
132
132
|
end
|
133
133
|
|
134
134
|
def transform_variants_later
|
135
|
-
named_variants.
|
136
|
-
|
135
|
+
preprocessed_variations = named_variants.filter_map { |_name, named_variant|
|
136
|
+
if named_variant.preprocessed?(record)
|
137
|
+
named_variant.transformations
|
138
|
+
end
|
139
|
+
}
|
140
|
+
|
141
|
+
if blob.preview_image_needed_before_processing_variants?
|
142
|
+
blob.create_preview_image_later(preprocessed_variations)
|
143
|
+
else
|
144
|
+
preprocessed_variations.each do |transformations|
|
145
|
+
blob.preprocessed(transformations)
|
146
|
+
end
|
137
147
|
end
|
138
148
|
end
|
139
149
|
|
@@ -98,6 +98,14 @@ module ActiveStorage::Blob::Representable
|
|
98
98
|
variable? || previewable?
|
99
99
|
end
|
100
100
|
|
101
|
+
def preview_image_needed_before_processing_variants? # :nodoc:
|
102
|
+
previewable? && !preview_image.attached?
|
103
|
+
end
|
104
|
+
|
105
|
+
def create_preview_image_later(variations) # :nodoc:
|
106
|
+
ActiveStorage::PreviewImageJob.perform_later(self, variations) if representable?
|
107
|
+
end
|
108
|
+
|
101
109
|
def preprocessed(transformations) # :nodoc:
|
102
110
|
ActiveStorage::TransformJob.perform_later(self, transformations) if representable?
|
103
111
|
end
|
@@ -74,8 +74,10 @@ module ActiveStorage
|
|
74
74
|
# The system has been designed to having you go through the ActiveStorage::Attached::One
|
75
75
|
# proxy that provides the dynamic proxy to the associations and factory methods, like +attach+.
|
76
76
|
#
|
77
|
-
#
|
78
|
-
# (i.e. destroyed) whenever the record is destroyed.
|
77
|
+
# The +:dependent+ option defaults to +:purge_later+. This means the attachment will be
|
78
|
+
# purged (i.e. destroyed) in the background whenever the record is destroyed.
|
79
|
+
# If an ActiveJob::Backend queue adapter is not set in the application set it to
|
80
|
+
# +purge+ instead.
|
79
81
|
#
|
80
82
|
# If you need the attachment to use a service which differs from the globally configured one,
|
81
83
|
# pass the +:service+ option. For instance:
|
@@ -162,8 +164,10 @@ module ActiveStorage
|
|
162
164
|
# The system has been designed to having you go through the ActiveStorage::Attached::Many
|
163
165
|
# proxy that provides the dynamic proxy to the associations and factory methods, like +#attach+.
|
164
166
|
#
|
165
|
-
#
|
166
|
-
# (i.e. destroyed) whenever the record is destroyed.
|
167
|
+
# The +:dependent+ option defaults to +:purge_later+. This means the attachments will be
|
168
|
+
# purged (i.e. destroyed) in the background whenever the record is destroyed.
|
169
|
+
# If an ActiveJob::Backend queue adapter is not set in the application set it to
|
170
|
+
# +purge+ instead.
|
167
171
|
#
|
168
172
|
# If you need the attachment to use a service which differs from the globally configured one,
|
169
173
|
# pass the +:service+ option. For instance:
|
data/lib/active_storage.rb
CHANGED
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: 7.1.
|
4
|
+
version: 7.1.5.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- David Heinemeier Hansson
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-
|
11
|
+
date: 2024-12-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -16,56 +16,56 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - '='
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 7.1.
|
19
|
+
version: 7.1.5.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: 7.1.
|
26
|
+
version: 7.1.5.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: 7.1.
|
33
|
+
version: 7.1.5.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: 7.1.
|
40
|
+
version: 7.1.5.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: 7.1.
|
47
|
+
version: 7.1.5.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: 7.1.
|
54
|
+
version: 7.1.5.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: 7.1.
|
61
|
+
version: 7.1.5.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: 7.1.
|
68
|
+
version: 7.1.5.1
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: marcel
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
@@ -116,6 +116,7 @@ files:
|
|
116
116
|
- app/jobs/active_storage/analyze_job.rb
|
117
117
|
- app/jobs/active_storage/base_job.rb
|
118
118
|
- app/jobs/active_storage/mirror_job.rb
|
119
|
+
- app/jobs/active_storage/preview_image_job.rb
|
119
120
|
- app/jobs/active_storage/purge_job.rb
|
120
121
|
- app/jobs/active_storage/transform_job.rb
|
121
122
|
- app/models/active_storage/attachment.rb
|
@@ -189,12 +190,12 @@ licenses:
|
|
189
190
|
- MIT
|
190
191
|
metadata:
|
191
192
|
bug_tracker_uri: https://github.com/rails/rails/issues
|
192
|
-
changelog_uri: https://github.com/rails/rails/blob/v7.1.
|
193
|
-
documentation_uri: https://api.rubyonrails.org/v7.1.
|
193
|
+
changelog_uri: https://github.com/rails/rails/blob/v7.1.5.1/activestorage/CHANGELOG.md
|
194
|
+
documentation_uri: https://api.rubyonrails.org/v7.1.5.1/
|
194
195
|
mailing_list_uri: https://discuss.rubyonrails.org/c/rubyonrails-talk
|
195
|
-
source_code_uri: https://github.com/rails/rails/tree/v7.1.
|
196
|
+
source_code_uri: https://github.com/rails/rails/tree/v7.1.5.1/activestorage
|
196
197
|
rubygems_mfa_required: 'true'
|
197
|
-
post_install_message:
|
198
|
+
post_install_message:
|
198
199
|
rdoc_options: []
|
199
200
|
require_paths:
|
200
201
|
- lib
|
@@ -209,8 +210,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
209
210
|
- !ruby/object:Gem::Version
|
210
211
|
version: '0'
|
211
212
|
requirements: []
|
212
|
-
rubygems_version: 3.
|
213
|
-
signing_key:
|
213
|
+
rubygems_version: 3.5.22
|
214
|
+
signing_key:
|
214
215
|
specification_version: 4
|
215
216
|
summary: Local and cloud file storage framework.
|
216
217
|
test_files: []
|