2019/10/02分のコミットです。
CHANGELOGにのったコミットは以下の通りです。
activestorage/CHANGELOG.md
- Allow storage services to be configured per attachment
- The
Content-Type
header is set on image variants when they're uploaded to third-party storage services.
Redis cache store: fail gracefully when max clients reached
activesupport/lib/active_support/cache/redis_cache_store.rb
の修正です。
Redis cache storeでclient接続数が最大数を越えた場合のエラーの際に、fallback処理が正しく呼ばれないバグがあったのを修正しています。
List activesupport as a direct dependency
Action Cable、Action Mailer、Active Storageのgemspecに、dependencyとしてactivesupport
を追加しています。
元々他のコンポーネント経由で追加されていた為問題は無かったのですが、直接使用しているコンポーネントなので明示的に追加されていた方が良いだろう、という事で追加されています。
Allow configure services for individual attachments
Active Storageの修正です。
Active Storageのサービスはattachment毎に指定出来るよう修正しています。
class User < ActiveRecord::Base has_one_attached :avatar, service: :s3 end class Gallery < ActiveRecord::Base has_many_attached :photos, service: :s3 end
基本的にはグローバルの設定が使用され、その設定を上書きしたい場合にのみ指定する必要があります。
この対応の為に、active_storage_blobs
tableに使用するサービス名を保存する為のカラム(service_name
)が追加されています。アップグレードの場合はカラム追加用のmigrationファイルを実行する必要があります。
Fix failing tests on Active Storage
activestorage/test/controllers/direct_uploads_controller_test.rb
の修正です。
先のサービスをattachment毎に指定出来るようにした対応の影響でコケていたテストがあったのを修正しています。
Fix GCS and Azure failing tests on Active Storage
activestorage/test/controllers/direct_uploads_controller_test.rb
の修正です。
引き続き先のサービスをattachment毎に指定出来るようにした対応の影響でコケていたテストがあったのを修正しています。
Set Content-Type on variant uploads
activestorage/app/models/active_storage/variant.rb
の修正です。
variant処理を行ったファイルをアップロードする際にもContent-Type
headerを指定するよう修正しています。
Require minitest/mock
since we rely on stub
in this test file
activestorage/test/models/variant_test.rb
の修正です。
不足していたminitest/mock
のrequireを追加しています。
Reverse assertion arguments: expected, actual
activestorage/test/models/variant_test.rb
の修正です。
assert_equal
の引数の順番をexpected, actualになるよう修正しています。
Update Gemfile.lock with newly added activesupport
dependencies
Gemfile.lock
の修正です。
List activesupport as a direct dependency でActive Supportのdependencyを追加した際にGemfile.lock
の更新が漏れていたのを対応しています。
activerecord/lib/active_record/scoping/named.rb
の修正です。
使用していないactive_support/core_ext/hash/except
のrequireを削除しています。
Fixed typo in attachment service test description. custom_ ervice -> custom service [ci skip]
activestorage/test/models/attached/many_test.rb
の修正です。
テストメソッド名をタイポしていたのを修正しています。
Removed repeated word 'done' from Active Storage guide [ci skip]
rails guideのActive Storage Overview
の修正です。
has_many_attached
の項のタイポを修正しています。
update package.json files to use https homepage value
各コンポーネントのpackage.json
内のhomepage
のリンクを全てhttpsに修正しています。
Add docs about _scopes option on enum. [ci skip]
activerecord/lib/active_record/enum.rb
のdocの修正です。
enum
のdocに_scopes
オプションについての説明を追加しています。