なるようになるブログ

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

rails commit log流し読み(2019/12/15)

2019/12/15分のコミットです。

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

actionpack/CHANGELOG.md


[ci skip] Fix a typo in the comment

actionpack/test/controller/route_helpers_test.rbのdocの修正です。

テストのコメントでandanにタイポしていたのを修正しています。


Merge pull request #28297

Action Pack、railtiesの修正です。

Cookieを書き込み際にSameSite attributeを指定するよう修正しています。

デフォルトはLaxで、Strictにしたい場合、config(config.action_dispatch.cookies_same_site_protection)に指定すればOKです。また、SameSiteを無効化したい場合は、先のconfigに:noneを指定すればOKです。

参考: draft-west-first-party-cookies-07 - Same-site Cookies


Fix missed reference to cookies.rb in cd1aeda0a9

railties/lib/rails/generators/rails/app/app_generator.rbの修正です。

app:updateでupgradeする際に参照するcookie initializerのファイル名を誤っていたのを修正しています。


Fix test name and test 6.1 default

railties/test/application/configuration_test.rbの修正です。

cookies_same_site_protectionに関するテストのテスト名が違うconfig名になっていたのを修正、及び、cookies_same_site_protectionの6.1のデフォルト値に関するテストを追加しています。


Consolidate and give context to after callback deprecation

Active Jobの修正です。

callback chainがhaltした場合にafter_enqueue / after_perform callbackが実行しなくなる対応についてのdeprecationメッセージが、callback毎に異なっていたのを、どちらのcallbackでも同じメッセージ(両方のcallbackについて言及した内容)を表示するよう修正しています。


make that a private instance method instead

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

callback chainがhaltした場合にafter_enqueue / after_perform callbackが実行しなくなる対応についてのdeprecationメッセージを出すメソッドがclass methodになっていたのをinstance methodに修正しています。