なるようになるブログ

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

rails commit log流し読み(2021/04/22)

2021/04/22分のコミットです。

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

railties/CHANGELOG.md


Ensure Rails.application.config_for always cast hashes to ActiveSupport::OrderedOptions.

空のenvironmentが指定されていた場合、Rails.application.config_forHashを返しまっていたのを、必ずActiveSupport::OrderedOptionsを返すよう修正しています。


Remove unused constant FileSystemResolver::EXTENSIONS

actionview/lib/action_view/template/resolver.rbの修正です。

使用していない定数を削除しています。


Setup autoload on SchemaCache

activerecord/lib/active_record/connection_adapters.rbactiverecord/lib/active_record/connection_adapters/abstract_adapter.rbの修正です。

SchemaCacheをautoloadの対象に追加しています。

元々はconnection adapterでloadするようになっていたのですが、Push schema cache loading into schema cache classでconnection adapterがロードされるより前(applicationの初期化処理)でSchemaCacheが使用されるようになった為。


Stop internationalizing Duration#inspect

activesupport/lib/active_support/core_ext/array/conversions.rbactivesupport/lib/active_support/duration.rbの修正です。

Duration#inspecti18nの初期化処理が実行されないよう(不要な場合)修正しています。i18nのバックエンドでDuration#inspectを使用している場合に、循環参照になってしまうのを避ける為。:


Merge pull request #40384 from eugeneius/teardown_shared_connection_pool

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

transactional testsの後で元のconnection poolに戻すよう修正しています。


Allow loading nested locales in engines

railties/lib/rails/engine/configuration.rbの修正です。

engineでlocaleファイルをロードする際に、ネストしたパスを指定出来るよう修正しています。


Merge pull request #42044 from basecamp/fix-are-multiple-schemes

Active Recordの修正です。

support_unencrypted_dataにtrueが指定されている場合に、元のencryption schemeが使用されないバグがあったのを修正しています。


Don't remove pool managers for test classes

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

テストで独自のコネクションを保持するクラスについては、pool managersを削除しないよう修正しています。


Refactor Cache::Entry compression handling

Active Supportの修正です。

Cache::Entryでのcache valueのcompressing処理について、constructorで行っていたのを、実際にserialize処理が必要になるまで遅らせるよう修正しています。実際の処理をcoderに移譲出来るようにする為。:


Rename previous_types_including_clean_text => previous_types

Active Recordの修正です。 previous_types_including_clean_textprevious_typesにリネームしています。


We want to check previous_types ignoring clean text type here

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

try_to_deserialize_with_previous_encrypted_typesメソッドでエラーの際にprevious_types_without_clean_textを使用してindexのチェックを行っていたのを、previous_typesを使用するよう修正しています。挙動としては変わらないのですが、可読性の為との事です。


Add missing text for encryption exception raising

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

previous schemesを使用してdecryptを行って、エラーになった場合のテストを追加しています。


Extract helper method for common logic across tests

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

複数テストで使用していた、encryptsを使用したmodelの定義処理をメソッドに切り出しています。


Add test to validate that ciphertext is returned when all previous schemes fail

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

previous schemesによる処理が失敗した場合のciphertextの戻り値に関するテストを追加しています。


Get rid of another SecureRandom.hex in MemCachedStoreTest

activesupport/test/cache/stores/mem_cache_store_test.rbの修正です。

SecureRandom.hexを使用していた箇所を、Random.randを使用するよう修正しています。/dev/urandomを使用しすぎてエントロピープールが枯渇するのを避ける為。


Eagerly close Dalli connections in MemCachedStoreTest

activesupport/test/cache/stores/mem_cache_store_test.rbの修正です。

MemCachedStoreTestのテストで、テストの後処理でDalliのconnectionをcloseするよう修正しています。