activestorage 7.0.0.rc3 → 7.0.0

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: 3e315b41277b62cc064dd97bfde10fbd93e832afafc5fca1674221b56215422e
4
- data.tar.gz: d15f735afe301059a83535bc79755e26f0b8d512218db54f96646354cc0e90a2
3
+ metadata.gz: 85a5cf62726ae4b98295bb1b62926f4f2fa15257babdb8d6251cff37c682c354
4
+ data.tar.gz: 65f662b546c7f3e5eaf0775f065174f6d7162721578d763213eefd2875565a7b
5
5
  SHA512:
6
- metadata.gz: 5880af2744d950125bb7a555d9e0c62170bcb37d4fa464207f14a59d0f9dad6c2db702442196eed57824ae9469855eca1582f8e05d822153a0d762e97bba854d
7
- data.tar.gz: 511a9174035ee239e44bcae22ec0b6ea27032dbd3fe9a084c2ca5d96c710747af08566f69b7c2b7f82e0738b00fafffd93ab6f1d133efba28038e1181c0c43bc
6
+ metadata.gz: 3ff136a959f672bb822be34f573209a3017744a8ba476e8f6e2ec3de11130b9fb1bf4e876ee2b0233b1a2bfa9acd66d211b2b9b329f533b9449fd8d084482ec6
7
+ data.tar.gz: 1d38c4402a276a86847c492c1d373fab6ace21b6149e03426744561a1528307947f4353645b53db5bdf32cfa4776aa0c15cfd0591631bdc554be66b481f5d77e
data/CHANGELOG.md CHANGED
@@ -1,3 +1,15 @@
1
+ ## Rails 7.0.0 (December 15, 2021) ##
2
+
3
+ * Support transforming empty-ish `has_many_attached` value into `[]` (e.g. `[""]`).
4
+
5
+ ```ruby
6
+ @user.highlights = [""]
7
+ @user.highlights # => []
8
+ ```
9
+
10
+ *Sean Doyle*
11
+
12
+
1
13
  ## Rails 7.0.0.rc3 (December 14, 2021) ##
2
14
 
3
15
  * No changes.
@@ -5,6 +17,10 @@
5
17
 
6
18
  ## Rails 7.0.0.rc2 (December 14, 2021) ##
7
19
 
20
+ * No changes.
21
+
22
+ ## Rails 7.0.0.rc1 (December 06, 2021) ##
23
+
8
24
  * `Add ActiveStorage::Blob.compose` to concatenate multiple blobs.
9
25
 
10
26
  *Gannon McGibbon*
@@ -5,7 +5,7 @@
5
5
  # WARNING: All Active Storage controllers are publicly accessible by default. The
6
6
  # generated URLs are hard to guess, but permanent by design. If your files
7
7
  # require a higher level of protection consider implementing
8
- # {Authenticated Controllers}[https://edgeguides.rubyonrails.org/active_storage_overview.html#authenticated-controllers].
8
+ # {Authenticated Controllers}[https://guides.rubyonrails.org/active_storage_overview.html#authenticated-controllers].
9
9
  class ActiveStorage::Blobs::ProxyController < ActiveStorage::BaseController
10
10
  include ActiveStorage::SetBlob
11
11
 
@@ -17,7 +17,7 @@ class ActiveStorage::Blobs::ProxyController < ActiveStorage::BaseController
17
17
  response.headers["Accept-Ranges"] = "bytes"
18
18
  response.headers["Content-Length"] = @blob.byte_size.to_s
19
19
 
20
- send_blob_stream @blob
20
+ send_blob_stream @blob, disposition: params[:disposition]
21
21
  end
22
22
  end
23
23
  end
@@ -5,7 +5,7 @@
5
5
  # WARNING: All Active Storage controllers are publicly accessible by default. The
6
6
  # generated URLs are hard to guess, but permanent by design. If your files
7
7
  # require a higher level of protection consider implementing
8
- # {Authenticated Controllers}[https://edgeguides.rubyonrails.org/active_storage_overview.html#authenticated-controllers].
8
+ # {Authenticated Controllers}[https://guides.rubyonrails.org/active_storage_overview.html#authenticated-controllers].
9
9
  class ActiveStorage::Blobs::RedirectController < ActiveStorage::BaseController
10
10
  include ActiveStorage::SetBlob
11
11
 
@@ -5,11 +5,11 @@
5
5
  # WARNING: All Active Storage controllers are publicly accessible by default. The
6
6
  # generated URLs are hard to guess, but permanent by design. If your files
7
7
  # require a higher level of protection consider implementing
8
- # {Authenticated Controllers}[https://edgeguides.rubyonrails.org/active_storage_overview.html#authenticated-controllers].
8
+ # {Authenticated Controllers}[https://guides.rubyonrails.org/active_storage_overview.html#authenticated-controllers].
9
9
  class ActiveStorage::Representations::ProxyController < ActiveStorage::Representations::BaseController
10
10
  def show
11
11
  http_cache_forever public: true do
12
- send_blob_stream @representation.image
12
+ send_blob_stream @representation.image, disposition: params[:disposition]
13
13
  end
14
14
  end
15
15
  end
@@ -5,7 +5,7 @@
5
5
  # WARNING: All Active Storage controllers are publicly accessible by default. The
6
6
  # generated URLs are hard to guess, but permanent by design. If your files
7
7
  # require a higher level of protection consider implementing
8
- # {Authenticated Controllers}[https://edgeguides.rubyonrails.org/active_storage_overview.html#authenticated-controllers].
8
+ # {Authenticated Controllers}[https://guides.rubyonrails.org/active_storage_overview.html#authenticated-controllers].
9
9
  class ActiveStorage::Representations::RedirectController < ActiveStorage::Representations::BaseController
10
10
  def show
11
11
  expires_in ActiveStorage.service_urls_expire_in
@@ -1,7 +1,7 @@
1
1
  class CreateActiveStorageVariantRecords < ActiveRecord::Migration[6.0]
2
2
  def change
3
3
  # Use Active Record's configured type for primary key
4
- create_table :active_storage_variant_records, id: primary_key_type do |t|
4
+ create_table :active_storage_variant_records, id: primary_key_type, if_not_exists: true do |t|
5
5
  t.belongs_to :blob, null: false, index: false, type: blobs_primary_key_type
6
6
  t.string :variation_digest, null: false
7
7
 
@@ -137,9 +137,11 @@ module ActiveStorage
137
137
  end
138
138
 
139
139
  def #{name}=(attachables)
140
+ attachables = Array(attachables).compact_blank
141
+
140
142
  if ActiveStorage.replace_on_assign_to_many
141
143
  attachment_changes["#{name}"] =
142
- if Array(attachables).none?
144
+ if attachables.none?
143
145
  ActiveStorage::Attached::Changes::DeleteMany.new("#{name}", self)
144
146
  else
145
147
  ActiveStorage::Attached::Changes::CreateMany.new("#{name}", self, attachables)
@@ -151,7 +153,7 @@ module ActiveStorage
151
153
  "To append new attachables to the Active Storage association, prefer using `attach`. " \
152
154
  "Using association setter would result in purging the existing attached attachments and replacing them with new ones."
153
155
 
154
- if Array(attachables).any?
156
+ if attachables.any?
155
157
  attachment_changes["#{name}"] =
156
158
  ActiveStorage::Attached::Changes::CreateMany.new("#{name}", self, #{name}.blobs + attachables)
157
159
  end
@@ -154,6 +154,18 @@ module ActiveStorage
154
154
  end
155
155
  end
156
156
 
157
+ initializer "action_view.configuration" do
158
+ config.after_initialize do |app|
159
+ ActiveSupport.on_load(:action_view) do
160
+ multiple_file_field_include_hidden = app.config.active_storage.delete(:multiple_file_field_include_hidden)
161
+
162
+ unless multiple_file_field_include_hidden.nil?
163
+ ActionView::Helpers::FormHelper.multiple_file_field_include_hidden = multiple_file_field_include_hidden
164
+ end
165
+ end
166
+ end
167
+ end
168
+
157
169
  initializer "active_storage.asset" do
158
170
  if Rails.application.config.respond_to?(:assets)
159
171
  Rails.application.config.assets.precompile += %w( activestorage activestorage.esm )
@@ -10,7 +10,7 @@ module ActiveStorage
10
10
  MAJOR = 7
11
11
  MINOR = 0
12
12
  TINY = 0
13
- PRE = "rc3"
13
+ PRE = nil
14
14
 
15
15
  STRING = [MAJOR, MINOR, TINY, PRE].compact.join(".")
16
16
  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: 7.0.0.rc3
4
+ version: 7.0.0
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: 2021-12-14 00:00:00.000000000 Z
11
+ date: 2021-12-15 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.0.0.rc3
19
+ version: 7.0.0
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.0.0.rc3
26
+ version: 7.0.0
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.0.0.rc3
33
+ version: 7.0.0
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.0.0.rc3
40
+ version: 7.0.0
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.0.0.rc3
47
+ version: 7.0.0
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.0.0.rc3
54
+ version: 7.0.0
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.0.0.rc3
61
+ version: 7.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: 7.0.0.rc3
68
+ version: 7.0.0
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: marcel
71
71
  requirement: !ruby/object:Gem::Requirement
@@ -199,12 +199,12 @@ licenses:
199
199
  - MIT
200
200
  metadata:
201
201
  bug_tracker_uri: https://github.com/rails/rails/issues
202
- changelog_uri: https://github.com/rails/rails/blob/v7.0.0.rc3/activestorage/CHANGELOG.md
203
- documentation_uri: https://api.rubyonrails.org/v7.0.0.rc3/
202
+ changelog_uri: https://github.com/rails/rails/blob/v7.0.0/activestorage/CHANGELOG.md
203
+ documentation_uri: https://api.rubyonrails.org/v7.0.0/
204
204
  mailing_list_uri: https://discuss.rubyonrails.org/c/rubyonrails-talk
205
- source_code_uri: https://github.com/rails/rails/tree/v7.0.0.rc3/activestorage
205
+ source_code_uri: https://github.com/rails/rails/tree/v7.0.0/activestorage
206
206
  rubygems_mfa_required: 'true'
207
- post_install_message:
207
+ post_install_message:
208
208
  rdoc_options: []
209
209
  require_paths:
210
210
  - lib
@@ -215,12 +215,12 @@ required_ruby_version: !ruby/object:Gem::Requirement
215
215
  version: 2.7.0
216
216
  required_rubygems_version: !ruby/object:Gem::Requirement
217
217
  requirements:
218
- - - ">"
218
+ - - ">="
219
219
  - !ruby/object:Gem::Version
220
- version: 1.3.1
220
+ version: '0'
221
221
  requirements: []
222
- rubygems_version: 3.2.15
223
- signing_key:
222
+ rubygems_version: 3.2.32
223
+ signing_key:
224
224
  specification_version: 4
225
225
  summary: Local and cloud file storage framework.
226
226
  test_files: []