なるようになるブログ

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

rails commit log流し読み(2018/06/26)

2018/06/26分のコミットです。

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


Use reflection.alias_candidate in table_alias_for

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

JoinDependency::Aliases#table_alias_forメソッドでaliasを生成する際に、独自に文字列を生成していたのを、reflection.alias_candidateメソッドを使用するよう修正しています。


references(:developers_projects_join) isn't needed if using where with hash condition

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

joinのテストから不要なreferencesの呼び出しを削除しています。


Lazily add Aggregations to composed_of models

activerecord/lib/active_record/aggregations.rbactiverecord/lib/active_record/base.rbの修正です。

ActiveRecord::BaseAggregations moduleをincludeしていたのを、composed_ofメソッド呼び出し時にAggregations moduleをincludeするよう修正しています。

Aggregations moduleはcomposed_ofを使用するときだけ必要、かつ、composed_ofメソッドを使用するのはかなりまれ、かつ、Aggregations moduleをincludeするとcomposed_ofメソッドを使用しない場合には不要なaggregation_cache hashが必ず生成されてしまう為、不要なオブジェクトの生成を減らせるようする為に上記修正を行っています。


Allow passing multiple exceptions to retry_on/discard_on

activejob/lib/active_job/exceptions.rbの修正です。

retry_ondiscard_onメソッドに複数のExceptionを指定出来るよう修正しています。


Generate a new key for each service test

Active Storageのテストの修正です。

各serviceのテストで使用するkeyに固定の値を使用していたのを、テスト毎にkeyを生成するよう修正しています。

同じkeyを使いまわすと、Google Cloud Storageの制限(Google::Cloud::ResourceExhaustedError: rateLimitExceeded: The total number of changes to the object rails-ci-activestorage/xx exceeds the rate limit. Please reduce the rate of create, update, and delete requests.)に引っかかってしまう事がある為。


Add example for no_touching? in active_record/no_touching for api docs [ci skip]

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

ActiveRecord::NoTouching#no_touching?にdocを追加しています。


Remove ActiveSupport::Concern from ActiveRecord::Aggregations

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

Lazily add Aggregations to composed_of modelsの対応により不要になったActiveSupport::Concernのextendを削除しています。


Enable TESTOPTS in railties tests

railties/Rakefileの修正です。

railtiesのテストでテスト実行時に指定したTESTOPTSが有効になるよう修正しています。