2024/11/26分のコミットです。
CHANGELOGにのったコミットは以下の通りです。
Handle nil in ConnectionPool::WeakThreadKeyMap
activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rbの修正です。
ConnectionPool::WeakThreadKeyMap#[]=メソッドでconnectionがnilの場合にエラーにならないよう修正しています。
Fix rails new with --devcontainer --pretend
railties/lib/rails/generators/rails/app/app_generator.rbの修正です。
rails newに--devcontainerと--pretendオプション両方を指定した場合にエラーになってしまうバグがあったのを修正しています。
Merge pull request #53384 from eval/issue/test-unit-generators
railties/lib/rails/generators.rbの修正です。
テストフレームワークにtest_unit以外を使用している場合に、test_unitに関するgeneratorがhelpに表示されないよう修正しています。
Merge pull request #53585 from jchilders/devcontainer-permissions-fix
.devcontainer/Dockerfileの修正です。
Railsの開発用のDockerfileのbuildが処理の途中でエラーになってしまうバグがあったのを修正しています。
Merge pull request #53011 from jeromedalbert/kamal-dbc-password
railties/lib/rails/generators/rails/app/templates/config/deploy.yml.ttの修正です。
kamal dbc実行時にパスワードをきかれないようにするために、dbconsoleに--include-passwordオプションを指定するよう修正しています。
Some test improvements for hash with indifferent access
activesupport/test/hash_with_indifferent_access_test.rbの修正です。
ActiveSupport::HashWithIndifferentAccessのテストに、default_procがコピーされること、updateにblockを指定した場合の挙動、等のテストを追加しています。
Use keywords in routing mapper
actionpack/lib/action_dispatch/routing/mapper.rbの修正です。
Revert keyword argument changes to routing mapperでRevertされた、各種routing用のメソッドでkeyword引数を使用するようにする対応を、下位互換の対応を追加し再度コミットしています。
Remove reload! command due to conflict with helper
railties/lib/rails/commands/console/irb_console.rbの修正です。
reload!がIRBのcommand、helper両方に登録されていたのを、commandの方を削除するよう修正しています。command、helper両方に登録されてしまうと、機能がコンフリクトしてしまい正しく動作しないケースがある為。
NOT VALID constraints should not dump in create_table
activerecord/lib/active_record/schema_dumper.rbの修正です。
PostgreSQLのNOT VALID constraintsを、create_table内ではなく、別の処理(add_check_constraint)としてschema dumpに出力するよう修正しています。CREATE TABLEにはNOT VALIDオプションを指定出来ない(ALTER TABLEで実行する必要がある)為。
Refactor schema dumper around constraint dumping
activerecord/lib/active_record/connection_adapters/postgresql/schema_dumper.rb、
activerecord/lib/active_record/schema_dumper.rbの修正です。
schema dumperのconstraintの出力処理について、commandsとargumentsを分離、constraint statements用の変数名からadd_ prefixを削除、等のリファクタリングを行っています。
Merge pull request #53702 from zzak/mysql2-prepared_statements
activerecord/lib/active_record/connection_adapters/mysql2/database_statements.rbの修正です
mysql2でprepared statementsを有効にした場合に一部処理が正しく動作していなかったのを修正しています。
activerecord/test/cases/explain_test.rbの修正です。
デバッグ用のprint処理を削除しています。
Merge pull request #52385 from fatkodima/preserve-order-within-batches
activerecord/lib/active_record/relation/batches.rbの修正です。
in_batchesなどのbatch系のメソッドでbatch iterationでデータの取得処理を行う際に、batch系のメソッドに指定されたorderを維持するよう修正しています。
Don't enable YJIT in development and test environments
railties/lib/rails/application/configuration.rbの修正です。
load_defaultsでの有効化処理で、developmentとtest environmentでは、デフォルトでYJITを有効化しないよう修正しています。 developmentとtestコードのreloadや再定義がよく行われる傾向にあり、そういう環境ではYJITを有効化しても高速にならない事が多いため。
More Mysql2 adapter fixes to support prepared statements
activerecord/lib/active_record/connection_adapters/mysql/quoting.rb、
activerecord/lib/active_record/connection_adapters/mysql2/database_statements.rbの修正です。
mysql2でprepared statementsを有効にした場合に一部処理が正しく動作していなかったのを修正した、Fix prepared statements on mysql2 adapterのfollowupとして、type cast処理でraw Time valuesを変換出来るよう修正、不要なチェックの削除、テストのクリーンアップ、等を行っています。
Use WeakKeyMap for the connection lease registry
activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rbの修正です。
connection lease registryの管理に独自のclassを使用していたのを、Ruby 3.3.5+の場合はObjectSpace::WeakKeyMapを使用するよう修正しています。独自のclassを使用していたのはObjectSpace::WeakKeyMapを使用するとGCでクラッシュしてしまう、という問題があった為なのですが、Ruby 3.3.5でその問題が解決済みの為。