2023/11/14分のコミットです。
CHANGELOGにのったコミットは以下の通りです。
activestorage/CHANGELOG.md
- Prevent
ActiveRecord::StrictLoadingViolationError
when strict loading is enabled and the variant of an Active Storage preview has already been processed (for example, by callingActiveStorage::Preview#url
). - Process preview image variant when calling
ActiveStorage::Preview#processed
.
Ensure globals reset after Active Storage tests
activestorage/test/test_helper.rb
の修正です。
strict_loading_by_default
に関するテストで、テストが失敗した場合もActiveRecord::Base.strict_loading_by_default
の設定を元の値に戻すよう修正しています。
Fix strict loading for Active Storage previews
activestorage/app/models/active_storage/blob.rb
の修正です。
strict loadingを有効にしている + Active Storage previewのvariantが生成済みの場合に、ActiveRecord::StrictLoadingViolationError
がraiseされてしまうバグがあったのを修正しています。
Process preview variant when processing preview
activestorage/app/models/active_storage/preview.rb
の修正です。
ActiveStorage::Preview#processed
実行時に、preview image variantも生成するよう修正しています。元々はattached_pdf.preview(:thumb).processed
などを実行した場合、thumb
variantは生成されず、URLを組み立てる際にはじめて生成されるようになっています。この対応により、variantについてもまとめて事前に作成出来るようになっています。
Fix grammar to aid readibility
rails guideのCreating and Customizing Rails Generators & Templates
の修正です。
Application Templates
セクションのグラマーの修正を行っています。
ActiveSupport::Deprecation handle blaming generated code
activesupport/lib/active_support/deprecation/reporting.rb
の修正です。
eval
で生成されたコード(e.g. テンプレートファイル)内でActiveSupport::Deprecation
を使用した場合に、callstackが正しく表示されないバグがあったのを修正しています。
Formally deprecate passing caller
to Deprecation#warn
activesupport/lib/active_support/deprecation/reporting.rb
の修正です。
ActiveSupport::Deprecation#warn
にcaller
を渡した場合の挙動をdeprecatedにしています。元々、use caller_locations instead of callerの時点で推奨されなくなっており、使用した場合Rubyのwarningが出るようになっていました。今回Railsのdeprecatorを使用してメッセージを出力するようにし、正式にdeprecateの扱いになっています。
Fix next Rails version in a deprecation message
activesupport/lib/active_support/deprecation/reporting.rb
の出力です。
先のコミットで追加したdeprecateメッセージ内の機能が削除されるRailsのバージョンが誤っていたのを修正しています。
ActionView::Template fix computation of strict locals
actionview/lib/action_view/template.rb
の修正です。
templateでstrict localsの指定がある、かつ、Railsがデフォルトでignoreするcollection renderingで設定するlocalsと同じ名前のkeywordが指定された場合に、正しく値が渡されないバグがあったのを修正しています。