2019/12/07分のコミットです。
CHANGELOGにのったコミットは以下の通りです。
activestorage/CHANGELOG.md
- Variants are tracked in the database to avoid existence checks in the storage service.
- Use
DiskController
for both public and private files. - Remove unused
disposition
andcontent_type
query parameters forDiskService
.
Track Active Storage variants in the database
Active Storageの修正です。
生成したblobのvariantsに関する情報をDBに保存するよう修正しています。元々はstorage serviceに対してそのvariantがあるかどうか毎回チェックしていたのですが、そのチェックをなくせるようにする為。
variantsの情報は新規に作成するテーブル(active_storage_variant_records
)に保存されるようになっています。
activestorage/db/update_migrate/20191206030411_create_active_storage_variant_records.rb
の修正です。
先程のActive Storageの対応で追加されたmigrationファイルのクラス名が誤っていたのを修正しています。
Add resolved route for ActiveStorage::VariantWithRecord
activestorage/config/routes.rb
の修正です。
先程追加されたvariantの情報を管理するためのクラス(ActiveStorage::VariantWithRecord
)用のルーティングを追加しています。
Go through ActiveStorage::Blob::Representable#variant to pick up tracking
activestorage/app/models/active_storage/preview.rb
の修正です。
ActiveStorage::Blob::Representable#variant
メソッドでvariantを取得するのにActiveStorage::VariantWithRecord
が使用されるよう(使用されるよう設定している場合のみ)修正しています。
Use DiskController for both public and private files
Active Storageの修正です。
disk serviceでpublic / privateでcontrollerが異なっていたのを、DiskController
でどちらの場合のファイルも扱えるよう修正しています。
Remove query params in DiskService
activestorage/lib/active_storage/service/disk_service.rb
の修正です。
disk _serviceが生成するURLから、使用していないquery parameter(disposition
とcontent_type
)を削除するよう修正しています。
Make sure variant is created on the same service
activestorage/app/models/active_storage/variant_with_record.rb
の修正です。
variantを生成する際に元のblobと違うサービスとしてvariantが生成されしまうバグがあったのを修正しています。
Update docs of String methods using ActiveSupport::Inflector [ci skip] (#37890)
activesupport/lib/active_support/core_ext/string/inflections.rb
のdocの修正です。
各メソッドのdocにActiveSupport::Inflector
の同名のメソッドへのリンクを追加しています。