なるようになるブログ

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

rails commit log流し読み(2020/06/05)

2020/06/05分のコミットです。

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


Revert "Ivar += in MRI is thread safe"

activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rbの修正です。

with_new_connections_blockedメソッドでインスタンス変数に対して+=を行う際にsynchronizeを使用していたのをMRIでは使用しないよう修正した、Ivar += in MRI is thread safeをRevertしています。

違うsynchronize block内で変更される事があるインスタンス変数な為、synchronizeと指定が無いとスレッドアンセーフになってしまう為。


Remove assumption that a primary config exists

activerecord/lib/active_record/railties/databases.rakerailties/lib/rails/info.rbの修正です。

primaryという名前のconfigがある事が前提となっているコードが残っていたのを修正しています。


Fix schema cache load and corresponding test

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

schema cacheをloadする際に、primary configが使用されるようになっていたのを、現在のenvで最初に指定されているconfigを使用するよう修正いsています。


Expand on specs of self join and add make doc changes to suggest users to also do foreign_key when doing self join

activerecord/test/cases/migration/references_foreign_key_test.rb、及び、rails guideのActive Record Associationsの修正です。

foreign_keyto_tableオプションを指定してself joinする際のテストを追加、及び、rails guideのto_tableを使用した場合のexampleを追加しています。


Revert "Lock benchmark-ips version "< 2.8""

benchmark-ipsのバージョンを2.8.0未満にロックした、Merge pull request #39108 from kamipo/lock_benchmarck-ips_versionをRevertしています。benchmark-ips 2.8.2でエラーが解消された為。


Use statement cache for find_by(author: david)

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

find_by + 引数にassociationを指定した際にstatement cacheが使用されるよう修正しています。


Don't give up statement cache just because of there is one composed_of

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

composed_ofが使用されている場合に、find_byメソッドでstatement cacheが使用されないようになっていたのを、可能な限りstatement cacheを使用するよう修正しています。


Auto-correct for delete_prefix/delete_suffix

rubocop-performance gemを1.6.1に更新、及び、String#sub(!)delete_suffix(!)delete_prefix(!)で置き換えるよう修正しています。


Silence Rake task backtraces

railties/lib/rails/commands/rake/rake_command.rbの修正です。

rake task実行時のbacktraceから、アプリケーションに関するtrace以外のtraceをフィルターするよう修正しています。