なるようになるブログ

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

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

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

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

activerecord/CHANGELOG.md


Merge pull request #33973 from rails/remove-catch-all

Action Viewのテストの修正です。

テストで、Rails 5.0.0でdeprecatedになった:action:controller path parametersを使用している箇所があったのを、使用しないよう修正しています。


Merge pull request #33974 from rails/remove-catch-all-from-am

actionmailer/test/url_test.rbの修正です。

テストで、Rails 5.0.0でdeprecatedになった:action:controller path parametersを使用している箇所があったのを、使用しないよう修正しています。


Change the empty block style to have space inside of the block

EnforcedStyleForEmptyBraces copを追加、及び、各ファイルにそれらのcopを適応しています。


Fix more offences

Action Viewのテストの修正です。

先のEnforcedStyleForEmptyBraces copを追加した対応で、ファイルの修正が漏れていた箇所があったのを対応しています。


Remove counter_cache_target which is no longer called

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

不要になったBelongsToAssociation#counter_cache_targetメソッドを削除しています。

が、これは違う対応の影響でまた必要になる為、後ほどrevertされています。


Merge pull request #33975 from JuanitoFatas/jf.fix-test-name

actionview/test/template/capture_helper_test.rbの修正です。

content_forメソッドのテストのテスト名がtest_capture_used_for_readになっていたのを、test_content_for_used_for_readに修正しています。


Merge pull request #33968 from gmcgibbon/stringify_db_configurations

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

ActiveRecord::Base.configurations=にsymbolizedsされたHashも指定出来るよう修正しています。


Fix "warning: shadowing outer local variable - config"

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

shadowing outer local variableのwarningが出ている箇所があったのを修正しています。


Use the same option for create database statements between Raketask and travis.rb

ci/travis.rbの修正です。

CIでDBを作成する際のオプションが、ローカルでテストを実行する為のDB作成rake taskで指定するオプションと同じ内容になるよう修正しています。


Update counter cache in memory if parent target is existed

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

counter cacheを使用していて対象のassociationをcollectionに追加した際に、メモリ内のcounter cacheの値が更新されないバグがあったのを修正しています。


Revert "Remove counter_cache_target which is no longer called"

BelongsToAssociation#counter_cache_targetメソッドを削除した、Remove counter_cache_target which is no longer calledをrevertしています。

先のcounter cacheの更新に関する修正との絡みで、再度特定のケースでupdate_countersを使用するよう修正しています。親associationのreloadによりquery数が増えてしまうのを避ける為、のようです。


Remove force parent loading when counter cache child is created/destroyed

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

counter cacheの対象のassociationを作成、又は、削除された際に、親associationが強制的にloadされていたのを、loadされないよう修正しています。

親associationがload済みでなくてもcounter cacheの更新処理は動作する為。