なるようになるブログ

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

rails commit log流し読み(2022/03/29)

2022/03/29分のコミットです。

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

railties/CHANGELOG.md


Add yarn install into bin/setup when not using importmap

railties/lib/rails/generators/rails/app/templates/bin/setup.ttの修正です。

importmapを使用していない場合、bin/setupのテンプレートにyarn installの実行処理を定義するよう修正しています。


Merge pull request #44770 from kevindew/attribute-names-optimisation

activemodel/lib/active_model/serialization.rbactiverecord/lib/active_record/serialization.rbの修正です。

avoid calling attributes.keys in ActiveModel#serializable_hashで追加されたActiveModel::Serialization#attribute_namesでのattribute_namesメソッドのオーバーライド処理を削除しています。

ActiveModel::Serializationattribute_namesを定義した結果、Active Recordのattribute_namesにも影響が出てしまいattributesを取得する度に余計なクエリーが実行されるようになってしまった為、attribute_namesメソッドのオーバーライドはやめて、別途attribute namesを取得する為のメソッドを追加し、そちらをオーバーライドするよう修正しています。


Make AR Presence and Absence validation docs more consistent [ci-skip]

activerecord/lib/active_record/validations/absence.rbactiverecord/lib/active_record/validations/presence.rbのdocの修正です。

Presence validationとAbsence validationについて説明している箇所の言い回しを修正しています。


Update codespell Action to Python 3.10

.github/workflows/lint.ymlの修正です。

codespell Actionで使用するPythonのバージョンを更新しています。


Merge pull request #44788 from jbampton/fix-yaml-word-case

各箇所のyamlYAMLに更新しています。


Remove confusing validations comments [ci-skip]

Active Record、Active Modelのdocの修正です。

一部のvaidateメソッドのdocにだけ、validationはデフォルトでは保存時にのみ実行される旨説明が記載されていたのを削除し、ActiveRecord::Validations moduleのdocでその説明を行うよう修正しています。全てのvalidateメソッドで同じ挙動な為。