なるようになるブログ

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

rails commit log流し読み(2022/05/25)

2022/05/25分のコミットです。

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

actionview/CHANGELOG.md

activesupport/CHANGELOG.md

activerecord/CHANGELOG.md


Explicitly states that the return value is seconds

activesupport/lib/active_support/time_with_zone.rbのdocの修正です。

TimeWithZone#-メソッドのdocに、引数の値オブジェクトのacts_like?がTimeの場合、戻り値はsecondsをFloatで返す旨説明を追加しています。


Change DeveloperWithDefaultNilableMentorScopeAllQueries name

activerecord/test/cases/scoping/default_scoping_test.rbactiverecord/test/models/developer.rbの修正です。

テスト用のmodelを適切な名前に修正しています。


Merge pull request #45061 from matthewd/assert-on-main-thread

activesupport/test/evented_file_update_checker_test.rbの修正です。

EventedFileUpdateCheckerのテストで、forkされたプロセスでエラーが発生した場合、テスト自体がfailするよう修正しています。


Move convert_to_model call from form_for to form_with

actionview/lib/action_view/helpers/form_helper.rbの修正です。

form_withで指定されたrecordに対して必ずconvert_to_modelによる変換処理が行われるよう修正しています。


Merge pull request #45174 from fatkodima/fetch_multi-force

activesupport/lib/active_support/cache.rbactivesupport/lib/active_support/cache/redis_cache_store.rbの修正です。

ActiveSupport::Cache::Store#fetch_multiメソッドにforceオプションを指定出来るよう修正しています。


Avoid validating a unique field if it has not changed and is backed by a unique index

activerecord/lib/active_record/validations/uniqueness.rbの修正です。

uniqueness validationで、値が変わっておらず、かつ、テーブルでユニーク制約が指定されていない場合、 validation処理が行われないよう修正しています。uniquenessチェックの為の不要なqueryが実行されるのを避ける為。