なるようになるブログ

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

rails commit log流し読み(2018/11/07)

2018/11/07分のコミットです。

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

railties/CHANGELOG.md


Add CVE note to security guide and gemspecs

rails guideのSecuring Rails Applications、及び、各gemspecの修正です。

Securing Rails Applications guideにDependency Management and CVEsの項を追加し、CVEの対応によるgemのバージョン変更のパッチは受け付けない旨説明を記載しています。また、各gemspecにも同様の説明を記載しています。

例えば、LoofahでCVEに対応した新しいバージョンのリリースが行われると、そのバージョンを指定するよう変更するPRがLoofahを使用しているrails-html-sanitizerに大量に来る(e.g. Update Loofah for CVE-2018-16468)、という現象が発生してしまい、それらの対応は受け付けていない(gemを使用しているアプリ側でbundle updateすれば良いだけなので)為、上記説明を追加しています。

因みにrails-html-sanitizerの場合、この記事を記載している時点で、バージョン変更のPRが13個来ていました。


Amend CVE note and security guide section wordings

rails guideのSecuring Rails Applications、及び、各gemspecの修正です。

先で追加したCVEに関する記載について、言い回し、及び、記載箇所をadd_dependencyの前に移動しています。


Merge pull request #34375 from y-yagi/add_connect_src_to_default_csp_initializer

railties/lib/rails/generators/rails/app/templates/config/initializers/content_security_policy.rb.ttの修正です。

rails newで生成するcontent_security_policy.rbに、webpack-dev-serverを使用している場合、connect_srcの指定が必要である旨説明とそのexampleを追加しています。


Add JSON support to rails properties route (/rails/info/properties).

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

rails properties routes(/rails/info/properties)にJSON formatのサポートを追加しています。/rails/info/properties.jsonにアクセスすると、rails propertiesがJSON formatで取得出来るようになっています。


Always add records to parent of nested transaction

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

transactionをnestし、nestした先のtransactionでコミットを行った場合に、コミットしたrecordのcallbackが実行されないケースがあるバグああったのを修正しています。