activestorage 7.0.0.rc1 → 7.0.1

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: f08091492d077c28be3b94de7fb3e4f02b6cd95c8c1d9bb987d620e2839e1208
4
- data.tar.gz: 4fe88a44de6de535c2167bf10917b08111eb77ea4afc40cbce753f19482d9292
3
+ metadata.gz: e336ca1d9ad086dd4cc7ddf18138ad28689e3a612768e3dc9eb1e6036f966c1d
4
+ data.tar.gz: 1678a62fc1662b30758a009b618c8bf4cd2dfaf9d59d53d7d1c0b41e1328229e
5
5
  SHA512:
6
- metadata.gz: e5558429f5f6e1d268ca1adc7cf553bbd1cb211aa6f3cb3a5d306c14b55256e95d88f012386a6e1597c2a79a9679687c2ef86bd6caf1bf3b8bf95dd8f85b25c3
7
- data.tar.gz: ec71d2715da6cc32f7f40f231c6e482f5d3984bb97d90bcb3634e65589e0430b5383452c7a71ddb551b0ee652116168b49c3a38bd3bdc3d8b87620aa408f6910
6
+ metadata.gz: 36e6731b1a41e94c8d803b58cf66ca3d2489beae1739a15d28c621ee2eb77d4d1ae6c757efd3b725a48dc774161dd8fc5762400acaa0c2fbbf0698a500ac1b42
7
+ data.tar.gz: 6e9c32f8b03fdb3e8949ceba091c30295f9558ff06710accc71fc28bfc0ca3eb49ed5c2f17dabeb83411865983c8abb129e37e35319d678cadce0614d916a00d
data/CHANGELOG.md CHANGED
@@ -1,3 +1,31 @@
1
+ ## Rails 7.0.1 (January 06, 2022) ##
2
+
3
+ * No changes.
4
+
5
+
6
+ ## Rails 7.0.0 (December 15, 2021) ##
7
+
8
+ * Support transforming empty-ish `has_many_attached` value into `[]` (e.g. `[""]`).
9
+
10
+ ```ruby
11
+ @user.highlights = [""]
12
+ @user.highlights # => []
13
+ ```
14
+
15
+ *Sean Doyle*
16
+
17
+
18
+ ## Rails 7.0.0.rc3 (December 14, 2021) ##
19
+
20
+ * No changes.
21
+
22
+
23
+ ## Rails 7.0.0.rc2 (December 14, 2021) ##
24
+
25
+ * No changes.
26
+
27
+ ## Rails 7.0.0.rc1 (December 06, 2021) ##
28
+
1
29
  * `Add ActiveStorage::Blob.compose` to concatenate multiple blobs.
2
30
 
3
31
  *Gannon McGibbon*
data/MIT-LICENSE CHANGED
@@ -1,4 +1,4 @@
1
- Copyright (c) 2017-2021 David Heinemeier Hansson, Basecamp
1
+ Copyright (c) 2017-2022 David Heinemeier Hansson, Basecamp
2
2
 
3
3
  Permission is hereby granted, free of charge, to any person obtaining
4
4
  a copy of this software and associated documentation files (the
@@ -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
@@ -4,7 +4,7 @@
4
4
  # These variants are used to create thumbnails, fixed-size avatars, or any other derivative image from the
5
5
  # original.
6
6
  #
7
- # Variants rely on {ImageProcessing}[https://github.com/janko-m/image_processing] gem for the actual transformations
7
+ # Variants rely on {ImageProcessing}[https://github.com/janko/image_processing] gem for the actual transformations
8
8
  # of the file, so you must add <tt>gem "image_processing"</tt> to your Gemfile if you wish to use variants. By
9
9
  # default, images will be processed with {ImageMagick}[http://imagemagick.org] using the
10
10
  # {MiniMagick}[https://github.com/minimagick/minimagick] gem, but you can also switch to the
@@ -46,9 +46,9 @@
46
46
  #
47
47
  # Visit the following links for a list of available ImageProcessing commands and ImageMagick/libvips operations:
48
48
  #
49
- # * {ImageProcessing::MiniMagick}[https://github.com/janko-m/image_processing/blob/master/doc/minimagick.md#methods]
49
+ # * {ImageProcessing::MiniMagick}[https://github.com/janko/image_processing/blob/master/doc/minimagick.md#methods]
50
50
  # * {ImageMagick reference}[https://www.imagemagick.org/script/mogrify.php]
51
- # * {ImageProcessing::Vips}[https://github.com/janko-m/image_processing/blob/master/doc/vips.md#methods]
51
+ # * {ImageProcessing::Vips}[https://github.com/janko/image_processing/blob/master/doc/vips.md#methods]
52
52
  # * {ruby-vips reference}[http://www.rubydoc.info/gems/ruby-vips/Vips/Image]
53
53
  class ActiveStorage::Variant
54
54
  attr_reader :blob, :variation
@@ -10,7 +10,7 @@ require "mini_mime"
10
10
  #
11
11
  # ActiveStorage::Variation.new(resize_to_limit: [100, 100], colourspace: "b-w", rotate: "-90", saver: { trim: true })
12
12
  #
13
- # The options map directly to {ImageProcessing}[https://github.com/janko-m/image_processing] commands.
13
+ # The options map directly to {ImageProcessing}[https://github.com/janko/image_processing] commands.
14
14
  class ActiveStorage::Variation
15
15
  attr_reader :transformations
16
16
 
@@ -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 )
@@ -9,8 +9,8 @@ module ActiveStorage
9
9
  module VERSION
10
10
  MAJOR = 7
11
11
  MINOR = 0
12
- TINY = 0
13
- PRE = "rc1"
12
+ TINY = 1
13
+ PRE = nil
14
14
 
15
15
  STRING = [MAJOR, MINOR, TINY, PRE].compact.join(".")
16
16
  end
@@ -1,5 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require "shellwords"
4
+
3
5
  module ActiveStorage
4
6
  class Previewer::VideoPreviewer < Previewer
5
7
  class << self
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  #--
4
- # Copyright (c) 2017-2021 David Heinemeier Hansson, Basecamp
4
+ # Copyright (c) 2017-2022 David Heinemeier Hansson, Basecamp
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
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.rc1
4
+ version: 7.0.1
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: 2021-12-06 00:00:00.000000000 Z
11
+ date: 2022-01-06 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.rc1
19
+ version: 7.0.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.0.0.rc1
26
+ version: 7.0.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.0.0.rc1
33
+ version: 7.0.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.0.0.rc1
40
+ version: 7.0.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.0.0.rc1
47
+ version: 7.0.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.0.0.rc1
54
+ version: 7.0.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.0.0.rc1
61
+ version: 7.0.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.0.0.rc1
68
+ version: 7.0.1
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: marcel
71
71
  requirement: !ruby/object:Gem::Requirement
@@ -199,10 +199,10 @@ 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.rc1/activestorage/CHANGELOG.md
203
- documentation_uri: https://api.rubyonrails.org/v7.0.0.rc1/
202
+ changelog_uri: https://github.com/rails/rails/blob/v7.0.1/activestorage/CHANGELOG.md
203
+ documentation_uri: https://api.rubyonrails.org/v7.0.1/
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.rc1/activestorage
205
+ source_code_uri: https://github.com/rails/rails/tree/v7.0.1/activestorage
206
206
  rubygems_mfa_required: 'true'
207
207
  post_install_message:
208
208
  rdoc_options: []
@@ -215,11 +215,11 @@ 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.22
222
+ rubygems_version: 3.2.32
223
223
  signing_key:
224
224
  specification_version: 4
225
225
  summary: Local and cloud file storage framework.