2020/05/17分のコミットです。
CHANGELOGにのったコミットは以下の通りです。
Merge pull request #39235 from hayesr/cte_alias_predication
activerecord/lib/arel/table.rb、
activerecord/lib/arel/visitors/to_sql.rbの修正です。
CTEを構築するのにArel::Nodes::Asを使用する必要があったのを、Arel::Tableから構築出来るよう修正しています。
Replace Hash#delete_if with Hash#compact!
activerecord/lib/active_record/connection_adapters/postgresql_adapter.rbの修正です
nilの値をdelete_ifで削除している箇所を、compactを使用するよう修正しています。
Use explicit spring boot loader (#39225)
railtiesの修正です。
binstubでSpringのロードを行っていたのを、configファイル(config/boot_with_spring.rb)で行うようにしています。
configファイル内でdevelopment / envでのみSpringがロードされるよう制御されています。また、ENVにUNSPRUNGを指定した場合にもSpringがロードされないようになっています。
Merge pull request #39249 from eugeneius/parameters_each_pair_each_value_enumerator
actionpack/lib/action_controller/metal/strong_parameters.rbの修正です。
ActionController::Parameters#each_pair / each_value をblock指定なしで呼び出した場合に、enumeratorを返すよう修正しています。Hashの挙動と合わせる為。
Merge pull request #39245 from paul-mannino/unload-app
railties/lib/rails/commands/encrypted/encrypted_command.rbの修正です。
encrypted show / editコマンドでenvironmentをロードしないよう修正しています。credentialsが無くてもエラーにならないようにする為。
actionpack/lib/action_dispatch/testing/test_process.rbの修正です。
fixture_pathが設定されている時にfixture_file_uploadメソッドでファイルのアップロードが行えないバグがあったのを修正しています。
Document how to reload at boot time [ci skip]
rails guideのAutoloading and Reloading Constants (Zeitwerk Mode)の修正です。
application boot時のautoloadingの方法について説明した、Autoloading when the application bootsの項を追加しています。
The warning for autoloaded constants on boot includes a solution
railties/lib/rails/application/finisher.rbの修正です。
initialization中にautoloading処理が実行された場合に出力するdeprecateメッセージに、reloader callback(Rails.application.reloader.to_prepare)を使用すれば initialization中のAutoloadingが安全に出来る旨説明を追加しています。
Refactor build_joins to use select_association_list
activerecord/lib/active_record/relation/query_methods.rbの修正です。
build_joinsメソッド内のjoin listの生成処理をselect_association_listメソッドを使用して行うようリファクタリングしています。
Remove sync_with_transaction_state to simplify code base
Active Recordの修正です。
各処理からsync_with_transaction_stateメソッドの呼び出しを削除しています。
sync_with_transaction_stateはトランザクションに関連付けられている場合に、Active Record objectの状態がトランザクションの現在の状態を反映するようにする為のメソッドで、Active Recordのobjectをトランザクション内で大量に作成するとmemory bloatが発生するという問題の為に追加された処理でした。
この修正では、トランザクション内のレコードの状態を保持するのにWeakRefを使用するようにして、memory bloatが発生しないよう対応を行っています。