activestorage 6.0.2.2 → 6.0.3.rc1

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: 2c422d6798079ba605d760872d4343987abe15f02bc076707758acf015c7ffab
4
- data.tar.gz: 5adb73bb7d56d869da11a034582c23d798bcfa49da05ce6666941c8b13f39419
3
+ metadata.gz: 8d0d41b4462cca3bcbd5e81fde082a5173ca11f3a22cb3532767e87d9b637304
4
+ data.tar.gz: 34030e6eaacb9d2460d122a70f63c9f64e0a488dfb5e5c4b1f14087c69f0cca2
5
5
  SHA512:
6
- metadata.gz: f1882e181e633c3a34713717010c35554a282548e998799d89333047335e259592d716115d724b792e5a2917c518824b17525efbe743037fb17a48b1e29770e7
7
- data.tar.gz: c155404fd662f561a437337f223e4ebd3043f7b3578a1f310bc357dba2aa5343dc31707621520d8f144bd7fd71813347419707de01108972d3dba96eb5bdbd6c
6
+ metadata.gz: f5e9410d7f1da3c75d4226b489c81345c1ad3e9e1a63454b27ba7a10b2e000dc94fafbb22a13e5f588b790d583e3171163d878aa549257f7f154a2b5a19ba58c
7
+ data.tar.gz: 0ccd7ac62e8d65eb6b654027df5a0f48b5ee5963ac114f93a5688b67d0e950c70900a9240ab7255ab8c64e5d4acdeff0a1844a5bcdc9a849f473450a1e90ca1a
@@ -1,3 +1,13 @@
1
+ ## Rails 6.0.3.rc1 (April 30, 2020) ##
2
+
3
+ * No changes.
4
+
5
+
6
+ ## Rails 6.0.2.2 (March 19, 2020) ##
7
+
8
+ * No changes.
9
+
10
+
1
11
  ## Rails 6.0.2.1 (December 18, 2019) ##
2
12
 
3
13
  * No changes.
data/README.md CHANGED
@@ -159,4 +159,4 @@ Bug reports for the Ruby on Rails project can be filed here:
159
159
 
160
160
  Feature requests should be discussed on the rails-core mailing list here:
161
161
 
162
- * https://groups.google.com/forum/?fromgroups#!forum/rubyonrails-core
162
+ * https://discuss.rubyonrails.org/c/rubyonrails-core
@@ -550,7 +550,7 @@
550
550
  this.file = file;
551
551
  this.attributes = {
552
552
  filename: file.name,
553
- content_type: file.type,
553
+ content_type: file.type || "application/octet-stream",
554
554
  byte_size: file.size,
555
555
  checksum: checksum
556
556
  };
@@ -5,7 +5,7 @@
5
5
  # the blob that was created up front.
6
6
  class ActiveStorage::DirectUploadsController < ActiveStorage::BaseController
7
7
  def create
8
- blob = ActiveStorage::Blob.create_before_direct_upload!(blob_args)
8
+ blob = ActiveStorage::Blob.create_before_direct_upload!(**blob_args)
9
9
  render json: direct_upload_json(blob)
10
10
  end
11
11
 
@@ -6,7 +6,7 @@ export class BlobRecord {
6
6
 
7
7
  this.attributes = {
8
8
  filename: file.name,
9
- content_type: file.type,
9
+ content_type: file.type || "application/octet-stream",
10
10
  byte_size: file.size,
11
11
  checksum: checksum
12
12
  }
@@ -26,6 +26,6 @@ module ActiveStorage::Blob::Identifiable
26
26
  end
27
27
 
28
28
  def update_service_metadata
29
- service.update_metadata key, service_metadata if service_metadata.any?
29
+ service.update_metadata key, **service_metadata if service_metadata.any?
30
30
  end
31
31
  end
@@ -59,7 +59,7 @@ class ActiveStorage::Preview
59
59
  # a stable URL that redirects to the short-lived URL returned by this method.
60
60
  def service_url(**options)
61
61
  if processed?
62
- variant.service_url(options)
62
+ variant.service_url(**options)
63
63
  else
64
64
  raise UnprocessedError
65
65
  end
@@ -71,7 +71,11 @@ class ActiveStorage::Preview
71
71
  end
72
72
 
73
73
  def process
74
- previewer.preview { |attachable| image.attach(attachable) }
74
+ previewer.preview do |attachable|
75
+ ActiveRecord::Base.connected_to(role: ActiveRecord::Base.writing_role) do
76
+ image.attach(attachable)
77
+ end
78
+ end
75
79
  end
76
80
 
77
81
  def variant
@@ -58,7 +58,7 @@ module ActiveStorage
58
58
  filename: attachable.original_filename,
59
59
  content_type: attachable.content_type
60
60
  when Hash
61
- ActiveStorage::Blob.build_after_unfurling(attachable)
61
+ ActiveStorage::Blob.build_after_unfurling(**attachable)
62
62
  when String
63
63
  ActiveStorage::Blob.find_signed(attachable)
64
64
  else
@@ -140,6 +140,10 @@ module ActiveStorage
140
140
  @attachment_changes ||= {}
141
141
  end
142
142
 
143
+ def changed_for_autosave? #:nodoc:
144
+ super || attachment_changes.any?
145
+ end
146
+
143
147
  def reload(*) #:nodoc:
144
148
  super.tap { @attachment_changes = nil }
145
149
  end
@@ -9,8 +9,8 @@ module ActiveStorage
9
9
  module VERSION
10
10
  MAJOR = 6
11
11
  MINOR = 0
12
- TINY = 2
13
- PRE = "2"
12
+ TINY = 3
13
+ PRE = "rc1"
14
14
 
15
15
  STRING = [MAJOR, MINOR, TINY, PRE].compact.join(".")
16
16
  end
@@ -2,8 +2,20 @@
2
2
 
3
3
  module ActiveStorage
4
4
  class Previewer::VideoPreviewer < Previewer
5
- def self.accept?(blob)
6
- blob.video?
5
+ class << self
6
+ def accept?(blob)
7
+ blob.video? && ffmpeg_exists?
8
+ end
9
+
10
+ def ffmpeg_exists?
11
+ return @ffmpeg_exists if defined?(@ffmpeg_exists)
12
+
13
+ @ffmpeg_exists = system(ffmpeg_path, "-version", out: File::NULL, err: File::NULL)
14
+ end
15
+
16
+ def ffmpeg_path
17
+ ActiveStorage.paths[:ffmpeg] || "ffmpeg"
18
+ end
7
19
  end
8
20
 
9
21
  def preview
@@ -16,11 +28,7 @@ module ActiveStorage
16
28
 
17
29
  private
18
30
  def draw_relevant_frame_from(file, &block)
19
- draw ffmpeg_path, "-i", file.path, "-y", "-vframes", "1", "-f", "image2", "-", &block
20
- end
21
-
22
- def ffmpeg_path
23
- ActiveStorage.paths[:ffmpeg] || "ffmpeg"
31
+ draw self.class.ffmpeg_path, "-i", file.path, "-y", "-vframes", "1", "-f", "image2", "-", &block
24
32
  end
25
33
  end
26
34
  end
@@ -82,8 +82,8 @@ module ActiveStorage
82
82
  raise NotImplementedError
83
83
  end
84
84
 
85
- def open(*args, &block)
86
- ActiveStorage::Downloader.new(self).open(*args, &block)
85
+ def open(*args, **options, &block)
86
+ ActiveStorage::Downloader.new(self).open(*args, **options, &block)
87
87
  end
88
88
 
89
89
  # Delete the file at the +key+.
@@ -80,8 +80,8 @@ module ActiveStorage
80
80
  disposition: content_disposition,
81
81
  content_type: content_type
82
82
  },
83
- { expires_in: expires_in,
84
- purpose: :blob_key }
83
+ expires_in: expires_in,
84
+ purpose: :blob_key
85
85
  )
86
86
 
87
87
  current_uri = URI.parse(current_host)
@@ -109,8 +109,8 @@ module ActiveStorage
109
109
  content_length: content_length,
110
110
  checksum: checksum
111
111
  },
112
- { expires_in: expires_in,
113
- purpose: :blob_token }
112
+ expires_in: expires_in,
113
+ purpose: :blob_token
114
114
  )
115
115
 
116
116
  generated_url = url_helpers.update_rails_disk_service_url(verified_token_with_expiration, host: current_host)
@@ -135,7 +135,7 @@ module ActiveStorage
135
135
  end
136
136
 
137
137
  def client
138
- @client ||= Google::Cloud::Storage.new(config.except(:bucket))
138
+ @client ||= Google::Cloud::Storage.new(**config.except(:bucket))
139
139
  end
140
140
  end
141
141
  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: 6.0.2.2
4
+ version: 6.0.3.rc1
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: 2020-03-19 00:00:00.000000000 Z
11
+ date: 2020-05-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: actionpack
@@ -16,42 +16,42 @@ dependencies:
16
16
  requirements:
17
17
  - - '='
18
18
  - !ruby/object:Gem::Version
19
- version: 6.0.2.2
19
+ version: 6.0.3.rc1
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.2.2
26
+ version: 6.0.3.rc1
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: activejob
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - '='
32
32
  - !ruby/object:Gem::Version
33
- version: 6.0.2.2
33
+ version: 6.0.3.rc1
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: 6.0.2.2
40
+ version: 6.0.3.rc1
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: activerecord
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
45
  - - '='
46
46
  - !ruby/object:Gem::Version
47
- version: 6.0.2.2
47
+ version: 6.0.3.rc1
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: 6.0.2.2
54
+ version: 6.0.3.rc1
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: marcel
57
57
  requirement: !ruby/object:Gem::Requirement
@@ -151,10 +151,10 @@ licenses:
151
151
  - MIT
152
152
  metadata:
153
153
  bug_tracker_uri: https://github.com/rails/rails/issues
154
- changelog_uri: https://github.com/rails/rails/blob/v6.0.2.2/activestorage/CHANGELOG.md
155
- documentation_uri: https://api.rubyonrails.org/v6.0.2.2/
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.2/activestorage
154
+ changelog_uri: https://github.com/rails/rails/blob/v6.0.3.rc1/activestorage/CHANGELOG.md
155
+ documentation_uri: https://api.rubyonrails.org/v6.0.3.rc1/
156
+ mailing_list_uri: https://discuss.rubyonrails.org/c/rubyonrails-talk
157
+ source_code_uri: https://github.com/rails/rails/tree/v6.0.3.rc1/activestorage
158
158
  post_install_message:
159
159
  rdoc_options: []
160
160
  require_paths:
@@ -166,11 +166,11 @@ required_ruby_version: !ruby/object:Gem::Requirement
166
166
  version: 2.5.0
167
167
  required_rubygems_version: !ruby/object:Gem::Requirement
168
168
  requirements:
169
- - - ">="
169
+ - - ">"
170
170
  - !ruby/object:Gem::Version
171
- version: '0'
171
+ version: 1.3.1
172
172
  requirements: []
173
- rubygems_version: 3.0.3
173
+ rubygems_version: 3.1.2
174
174
  signing_key:
175
175
  specification_version: 4
176
176
  summary: Local and cloud file storage framework.