なるようになるブログ

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

rails commit log流し読み(2021/05/03)

2021/05/03分のコミットです。

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

activemodel/CHANGELOG.md

activesupport/CHANGELOG.md


Fix and improve the method signature for try and try!

activesupport/lib/active_support/core_ext/object/try.rbの修正です。

tryメソッドとtry!メソッドの引数名を適切な名前に修正しています。


Ensure association target classes exist

Active Recordの修正です。

singular associationに存在しないconstantが指定されていた場合に、readerメソッドを使用した際にexceptionをraiseするよう修正しています。collection associationは既にexceptionをraiseするようになっており、挙動を合わせる為。


Fix isolated test failure

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

models/ownerのrequireが不足していたのを修正しています。


Fix isolated test failure in test/cases/adapters/mysql2/count_deleted_rows_with_lock_test.rb

activerecord/test/cases/adapters/mysql2/count_deleted_rows_with_lock_test.rbの修正です。

models/carのrequireが不足していたのを修正しています。


Refactor schema creation to extract new_foreign_key_definition

Active Recordの修正です。

schema作成時のforeign_keyの定義処理について、メソッド(new_foreign_key_definition)に切り出すようリファクタリングしています。


Refactor schema creation to extract new_check_constraint_definition

Active Recordの修正です。

schema作成時のconstraintの定義処理について、メソッド(new_check_constraint_definition)に切り出すようリファクタリングしています。


Remove unused clear_association_cache

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

使用していないclear_association_cacheメソッドを削除しています。


Fix add_foreign_key to prevent double prefix/suffix

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

add_foreign_keyメソッドでprefix/suffixが二重に指定されるようになってしまっていたのを修正しています。


Modify assert_storage_performance to be quiet by default

activerecord/test/cases/encryption/performance/storage_performance_test.rbの修正です。

assert_slower_by_at_mostメソッドと同様に、assert_storage_performanceメソッドについてもデフォルトでデバッグ情報は出力しないよう修正しています。


Cache and reuse generated attribute methods

Active Model、Active Recordの修正です。

attibute methodsをcacheして、既に生成済みのmethods再利用するよう修正しています。attibute methods生成に関するメモリ使用量を減らせるようにする為。


Deprecate implicitly coercing objects to string in ActiveSupport::SafeBuffer

activesupport/lib/active_support/core_ext/string/output_safety.rbの修正です。

ActiveSupport::SafeBufferto_strが定義されていないオブジェクトへのStringの変換処理のサポートがdeprecateになりました。本来エラーにすべきようなオブジェクトまでStringに変換するようになっていて、結果予期せぬ結果が得られてしまう事がある為。