なるようになるブログ

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

rails commit log流し読み(2021/07/23)

2021/07/23分のコミットです。

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

actionpack/CHANGELOG.md

activemodel/CHANGELOG.md


Avoid double wait in EventedFileUpdateCheckerTest

Active Supportのテストの修正です。

EventedFileUpdateCheckerのテストで、wait処理が重複して行われてしまっていたのを修正しています。


Merge branch 'opt_into_open_redirect_protection'

Action Packの修正です。

redirect_toに他のホストへのリダイレクトを許可するかどうかを指定する為のオプション(allow_other_host)を追加しています。このオプションはグローバルのconfigでも指定出来るようになっており、config.action_controller.raise_on_open_redirectsにtrueを指定すると、他のホストへのリダイレクトを試みた際に、ArgumentErrorをraiseするようになります(新規に作成するアプリではデフォルトでtrueになっています)。


Add host authorization middleware options to the config guide

rails guideのConfiguring Rails Applicationsの修正です。

host authorization middlewareに指定出来るconfigについての説明を追加しています。


Slimmer ActiveModel::Errors#inspect

activemodel/lib/active_model/errors.rbの修正です。

ActiveModel::Errorsインスタンスinspectした際に、エラーの情報だけが出力されるよう修正しています。

# before
#<ActiveModel::Errors:0x00007ff68cda24f8 @base=#<Foo id: 6, created_at: "2021-07-09 04:28:48.056662000 +0000", updated_at: "2021-07-09 04:28:48.168576000 +0000", email: "user@example.com", name: "Foo Bar", company: "Foo", activated_at: "2021-07-09 04:28:39.039853000 +0000">, @errors=[]>

# after
#<ActiveModel::Errors [#<ActiveModel::Error attribute=base, type=invalid, options={}>]>