なるようになるブログ

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

rails commit log流し読み(2021/10/28)

2021/10/28分のコミットです。

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

activesupport/CHANGELOG.md


Revert "Call Executor#wrap around each test"

Rails.application.executor hookをテストの実行前後に実行するよう修正した、Call Executor#wrap around each testをRevertしています。既存のintegration testsを壊してしまうケースがある為。


Merge pull request #43549 from cgriego/no-select-all-from-information-schema-tables

activerecord/lib/active_record/connection_adapters/mysql/schema_statements.rbの修正です。

MySQL adapterでinformation_schema.tablesからカラムを取得する際に、SELECT *していたのを、必要なカラムのみ取得するよう修正しています。SELECT *だとMySQLのバージョン、設定によっては大変遅いSQLになってしまう為。


Setup bootsnap to speedup TestRunnerTest

railties/test/isolation/abstract_unit.rbの修正です。

テストでRailsのコマンドを直接実行する際に、bootsnapを利用するよう修正しています。


Refactor DescendantsTracker to leverage native Class#descendants on Ruby 3.1

Active Supportの修正です。

ActiveSupport::DescendantsTrackerRuby本体のClass#descendantsを使うよう修正、及び、Class#descendantsが追加された事により不要になったActiveSupport::DescendantsTracker.direct_descendantsActiveSupport::DescendantsTracker#direct_descendantsメソッドをdeprecateにしています。


Stop using the deprecated direct_descendants in Active Record

activerecord/lib/active_record/model_schema.rbの修正です。

先のコミットでdeprecateになったActiveSupport::DescendantsTracker.direct_descendantsを使用している箇所があったのを修正しています。


Rebalance Railties tests

railties/Rakefileの修正です。

テストの実行時間の見積もりを、現在の実際のテストの実行時間の値を参考に修正しています。


Call Executor#wrap around each test

Active Support、Active Recordの修正です。

Revert "Call Executor#wrap around each test"でRevertした、Rails.application.executor hookをテストの実行前後に実行する対応を再度コミットしています。 なお、意外と既存のアプリへの影響が大きそう、という理由で、既存のアプリについてはデフォルトは無効化されるようになっています。config.active_support.executor_around_test_case = trueload_defaultsで最新バージョンを指定すると有効化されるようになっています。