なるようになるブログ

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

rails commit log流し読み(2020/05/01)

2020/05/01分のコミットです。

CHANGELOGへの追加はありませんでした。


Batch attribute methods definition in a single module_eval

activemodel/lib/active_model/attribute_methods.rbの修正です。

attribute methodsを定義する際に、メソッド毎にmodule_evalを実行していたのを、まとめて1つのmodule_evalでメソッドの定義を行うよう修正しています。


Should not rely on the global Arel::Table.engine in the framework

Active Recordの修正です。

グローバルのArel::Table.engineに依存していた処理があったのを、依存しないよう修正しています。

DBを複数使用している場合、グローバルのArel::Table.engineとcurrent connectionは同じ値とは限らない為。


Merge pull request #39064 from kamipo/pg-1.1

pg gemのrequireバージョンを1.1以上に修正しています。

違う対応で必要な機能が1.1.0で追加されている、1.1.0以上をサポートする事でクリーンアップ出来る箇所がある、等の理由により対応が行われています。


Merge pull request #39063 from kamipo/remove_useless_typecast_on_aggregation

Active Recordの修正です。

aggregated valueに対するtype cast処理を削除しています。

PostgreSQL adapterの為にcast処理が必要だったのですが、adapter側でnumeric valueを直接返す事ができるようになり、cast処理は不要になった為削除しています。


Fix random CI failure due to non-deterministic order

activerecord/test/cases/associations/nested_through_associations_test.rbの修正です。

データを取得する際にorderを指定するよう修正しています。結果が不定になるのを避ける為。


Replace result_as_array by type mapping

activerecord/lib/active_record/connection_adapters/postgresql/database_statements.rbactiverecord/lib/active_record/connection_adapters/postgresql_adapter.rbの修正です。

PostgreSQL adapterでqueryの実行結果のArrayへの変換処理を独自メソッドで行っていたのを、type mappingを使用するよう修正しています。


Avoid quite useless loop in find_by_sql

activerecord/lib/active_record/connection_adapters/postgresql/database_statements.rbactiverecord/lib/active_record/querying.rbの修正です。

find_by_sqlメソッドで、不要な場合ばcolumn typeの設定処理のループを行わないよう修正しています。


Also batch attribute readers and writers

Active Recordの修正です。

Batch attribute methods definition in a single module_evalで、readerとsetterについて対応が漏れていた為、readerとsetterについても1つのmodule_evalでまとめてメソッドの定義を行うようにしています。


Add mention to shared section in config_for docs [ci skip]

rails guideのConfiguring Rails Applications、及び、railties/lib/rails/application.rbのdocの修正です。

config_forのshared sectionについての説明を追加しています。


Remove internal without_transaction_enrollment callbacks

activerecord/lib/active_record/touch_later.rbactiverecord/lib/active_record/transactions.rbの修正です。

without_transaction_enrollment callbackを削除しています。

internal用に追加されたが現在は使っていない、かつ、具体的にユーザが使用出来るユースケースも現状無い、という理由で削除されています。