なるようになるブログ

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

rails commit log流し読み(2019/08/07)

2019/08/07分のコミットです。

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

activestorage/CHANGELOG.md

actionmailbox/CHANGELOG.md


Fix thread safety of prevent_writes

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

prevent_writesがスレッドアンセーフな変数になっていた(複数スレッドで読み込み / 書き込みを行った際に書き込み処理が正しく行えないケースがあった)のを、スレッド毎に変数を保持するようにしてスレッドセーフになるよう修正しています。


Fix Gemfile.lock

Gemfile.lockの修正です。

Update rails-html-sanitizer to 1.1.0 in actionview.gemspecrails-html-sanitizerのバージョンを更新した際にGemfile.lockの更新が漏れていたのを対応しています。


Update azure-storage gem to latest version

Active Storageの修正です。

Azure serviceへのファイルアップロード処理に使用していたgemをazure-storageからazure-storage-blobに変更、及び、それに合わせて各処理を修正しています。

azure-storage gemはpreview版という位置づけ、かつ、現在はメンテされておらず、今はazure-storage-blobを使用するが推奨されている為。


Merge pull request #36870 from jhawthorn/schema_sha

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

test databaseでschemaのreloadが必要かどうかチェックするのにmigration statusを使用していたのを、schema.rbsha1の値でチェックするよう修正しています。

migration statusだとmigrationのrollbackを実行した際などに自動での対応が出来ず手動でコマンドを実行する必要があったのですが、schema.rbsha1だとrollback時もschema.rbsha1も変わる為、自動で対応が行えるようになっています。なお、sha1の値はDB(internal metadata table)に保存されるようになっています。


Fix GROUP BY aggregation alias to not duplicate "_" chars

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

GROUP BY + count + countで生成さされたaliasでorderを行った際にエラーになってしまうバグがあったのを修正しています。


Fix typo in autoloading_and_reloading_constants

rails guideのAutoloading and Reloading Constants (Zeitwerk Mode)の修正です。

availableavailabeにタイポしていたのを修正しています。


Allow testing multipart emails in Action Mailbox

actionmailbox/lib/action_mailbox/test_helper.rbの修正です。

create_inbound_email_from_mailreceive_inbound_email_from_mailメソッドの引数にblockを指定した場合に、そのblockをそのままMail.newの引数に渡すよう修正しています。multipart emailの作成を簡単に出来るようにする為。

create_inbound_email_from_mail do
  to "David Heinemeier Hansson <david@example.com>"
  from "Bilbo Baggins <bilbo@example.com>"
  subject "Come down to the Shire!"

  text_part do
    body "Please join us for a party at Bag End"
  end

  html_part do
    body "<h1>Please join us for a party at Bag End</h1>"
  end
end

Correct assertion argument order

actionmailbox/test/unit/test_helper_test.rbの修正です。

assert_equalメソッドの引数が逆(actual、expectedの順になっていた)になっていたのを修正しています。