なるようになるブログ

読書感想文かrailsについてかrubyについてか

rails commit log流し読み(2023/11/14)

2023/11/14分のコミットです。

CHANGELOGにのったコミットは以下の通りです。

activestorage/CHANGELOG.md


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#warncallerを渡した場合の挙動を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が指定された場合に、正しく値が渡されないバグがあったのを修正しています。