2024/02/14分のコミットです。
CHANGELOGにのったコミットは以下の通りです。
bin/rails testwill no longer load files named*_test.rbif they are located in thefixturesfolder.
- Deprecate
config.active_record.warn_on_records_fetched_greater_thannow thatsql.active_recordnotification includes:row_countfield. - Add
ActiveRecord::Base.with_connectionas a shortcut for leasing a connection for a short duration.
Don't load *_test.rb file from the "fixtures" folder:
railties/lib/rails/test_unit/runner.rbの修正です。
bin/rails test実行時にfixturesフォルダ配下にあるテストファイル(*_test.rb)をロードしないよう修正しています。
Raise error for Trilogy when prepared_statements is true
activerecord/lib/active_record/connection_adapters/trilogy_adapter.rbの修正です
Trilogyでサポートしていないprepared_statements: trueがconfigファイルで指定された場合に、ArgumentErrorをraiseするよう修正しています。
Register autoload for ActiveJob::Arguments
Active Jobの修正です。
ActiveJob::Argumentsをautoloadの対象に追加しています。[Fix #50713] Do not trigger loading of ActiveJob::Base in ActiveJob::TestHelperの対応により、ActiveJob::Argumentsをrequireしていないが使用する、というケースがtest envで発生するようになっており、そのための対応との事です。
Merge pull request #51019 from jhawthorn/key-provider
activerecord/lib/active_record/encryption/encrypted_attribute_type.rb、
activerecord/lib/active_record/encryption/scheme.rbの修正です。
encryption_options、decryption_options、及び、key_providerの値をメモ化しないよう修正しています。with_encryption_contextでそれらの値をoverride出来るようにするため。
Merge pull request #51035 from rails/rm-docs-actioncable
Action Cableのdocの修正です。
docのフォーマットをMarkdownに変更しています。
Merge pull request #51063 from anonychun/speedup-docker-build-time
railtiesの修正です。
rails newで生成するDockefileで、同じ依存パッケージを複数回インストールしてしまっている箇所があったのを、同じパッケージについて重複してインストール処理が実行されないよう修正しています。
Deprecate config.active_record.warn_on_records_fetched_greater_than (#51007)
activerecord/lib/active_record/railtie.rbの修正です。
config.active_record.warn_on_records_fetched_greater_thanをdeprecatedにしています。Add row_count field to sql.active_record notificationで:row_count fieldをsql.active_record hookのpayloadに追加しており、レコード数のチェックをしたい場合その値を使用すれば良くなったため。
Merge pull request #51040 from hendrixfan/remove-rollup-option
actioncable/rollup.config.jsの修正です。
rollup.config.jsで不正なconfig名を指定していたのを削除しています。
Address Defining enums with keyword arguments warning in Action Mailbox
actionmailbox/app/models/action_mailbox/inbound_email.rbの修正です。
Deprecate defining enums with keywords argsでdeprecatedになったenumの記法を使用している箇所があったのを修正しています。
Update Method#duplicable? to be consistent with Ruby 3.4
activesupport/lib/active_support/core_ext/object/duplicable.rbの修正です。
Method#duplicable?がRuby 3.4でTypeErrorをraiseしてしまう場合があったのを修正しています。Ruby本体でProc, Method, UnboundMethod及びBindingのclone/dupの挙動が整理された影響との事です。
参考: proc.c: get rid of CLONESETUP
Merge pull request #50938 from Shopify/refactor-query-cache-to-pool
Active Recordの修正です。
connection poolでQueryCacheを保持するようリファクタリングしています。transactional fixturesをconnectionのキャッシュに依存しないようリファクタリングした、Decouple transactional fixtures and active connectionsと同様に、connectionのキャッシュを削除しても動作するようにする為の対応の一環。
Refactor some Active Record tests
Active Recordのテストの修正です。
adapter nameを取得するのに#adapter_nameメソッドを使用するよう修正、connectionのインスタンスに対しテスト内で独自のモンキーパッチを使用していたのを既存のメソッドで対応するよう修正、及び、SCHEMA queryを無視するよう修正しています。
Add ActiveRecord::Base.with_connection as a shortcut
Active Recordの修正です。
指定されたblockの中でのActiveRecord::Base.connectionの呼び出しが全て同じconnectionを返すための、ActiveRecord::Base.with_connectionを追加しています。 特定のリクエストやジョブの実行時で、同じconnectionで処理が実行される事を保証したい場合に使用する事を想定しているようです。
activerecord/lib/active_record/connection_handling.rbの修正です。
先程追加されたActiveRecord::Base.with_connectionがAPI docに表示されるよう修正しています。
Improve ConnectionHandlingTest
activerecord/test/cases/connection_handling_test.rbの修正です。
assertionでチェックするconnectionを間違えている箇所があったのを修正しています。