なるようになるブログ

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

rails commit log流し読み(2023/02/09)

2023/02/09分のコミットです。

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

actionmailer/CHANGELOG.md

actionview/CHANGELOG.md


Added option to show all headers for mailer previews

railties/lib/rails/templates/rails/mailers/email.html.erbの修正です。

mailer previewでメールの全てのheaderを表示出来るよう修正しています。


token_list: Guard Stimulus' data-action from multiple escapes

actionview/lib/action_view/helpers/tag_helper.rbの修正です。

token_listメソッドで引数に指定されたHTMLのescape処理が一度だけ行われるよう修正しています。元々は複数回処理が実行されてしまい、戻り値をCGI.unescape_htmlに渡しても元のHTMLが一度では復元出来なくなっていたのですが、今回の対応で一度のCGI.unescape_htmlで元に戻せるようになっています。


[Action Cable] Stop logging filtered params

Action Cableの修正です。

Action Cableのlogにfilter対象のパラメータがそのまま出力されてしまっていたのを、他の処理同様にfilterされるよう修正しています。


Add Object#in? support for open date ranges

activesupport/lib/active_support/core_ext/object/inclusion.rbの修正です。

Object#in?でopen date rangeをサポートするよう修正しています。


Show headers in mailer previews only if there are headers present

railties/lib/rails/templates/rails/mailers/email.html.erbの修正です。

mailer previewでメールにheaderがある場合のみ、header表示のリンクを表示するよう修正しています。


Document MessageEncryptor method options [ci-skip]

activesupport/lib/active_support/message_encryptor.rbのdocの修正です。

MessageEncryptorの各メソッドのdocに、メソッドで使用出来るオプションについての説明を追加しています。


Document MessageVerifier method options [ci-skip]

activesupport/lib/active_support/message_verifier.rbのdocの修正です。

MessageVerifierの各メソッドのdocに、メソッドで使用出来るオプションについての説明を追加しています。


Factor rotator tests into dedicated classes

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

ActiveSupport::MessageVerifierActiveSupport::MessageEncryptorのrotateに関するテストを専用のファイルに切り出すよう修正しています。


Detach Messages::Rotator from SecureCompareRotator

activesupport/lib/active_support/secure_compare_rotator.rbの修正です。

ActiveSupport::Messages::Rotatorでrotate処理にActiveSupport::SecureCompareRotatorを使用していたのを、使用しないよう修正しています。ActiveSupport::SecureCompareRotatorにはActiveSupport::Messages::Rotatorには不要な処理が多数含まれており、それらの処理が追加されるのを避ける為。


Fix typo in docs

rails guideのAction Controller Overview、及び、railties/lib/rails/health_controller.rbのdocの修正です。

doc内のタイポの修正を行っています。


Avoid double serialization of message data

Active Supportの修正です。

ActiveSupport::MessageVerifier及びActiveSupport::MessageEncryptorにmetadataを含むmessageを渡した場合に、serialize処理及びURL-encodeが2回行われていたいたのを、一度だけ行うよう修正しています。これによりmessageのgenerate/verifyの性能が改善するのですが、生成されるデータのフォーマットが変わってしまう為、config.load_defaults 7.1またはconfig.active_support.use_message_serializer_for_metadataにtrueを指定した場合のみこの対応が行われるようになっています。


Update deprecation.rails hook in guides

rails guideのActive Support Instrumentationの修正です。

deprecation.rails hookで渡されるeventデータを最新の内容に更新しています。


Refactor MessageEncryptor and MessageVerifier

Active Supportの修正です。

ActiveSupport::MessageVerifier及びActiveSupport::MessageEncryptorの共通処理を専用のクラスとして切り出すよう修正しています。


RE: defer and async options in javascript_include_tag

actionview/lib/action_view/helpers/asset_tag_helper.rbのdocの修正です。

javascript_include_tagメソッドにdefer、及び、asyncオプションについての説明を追加しています。


:hot_pepper: Spice up new Mailer preview for all headers

actionmailer/CHANGELOG.mdの修正です。

mailer previewでメールの全てのheaderを表示出来るようにした対応のエントリーについて、詳細な説明を追加しています。


Add a note about ENV["SECRET_KEY_BASE_DUMMY"] to asset_pipeline guide

rails guideのThe Asset Pipelineの修正です。

Allow assets:precompile to be run in a production build step without passing in RAILS_MASTER_KEYで追加されたENV["SECRET_KEY_BASE_DUMMY"]についての説明をguideに追加しています。


Document option section style for API guidelines

rails guideのAPI Documentation Guidelinesの修正です。

Description Listsの項に、option section styleでoptionの詳細な説明とexampleを追加する場合の例を追加しています。


Move strict_loading_violation event down and add info about config

rails guideのActive Support Instrumentationの修正です。

Active Recordのhookについて説明している箇所で、strict_loading_violation.active_record hookが先頭で説明されていたのを、sql.active_recordを先頭に移動しています。sql.active_recordの方が一般的に使われるhookだと思われる為。合わせて、strict_loading_violation.active_record hookについての説明にconfig.active_record.action_on_strict_loading_violation:logが指定されている場合のも出力される旨説明を追加しています。


Fix changelog example in actionpack

actionpack/CHANGELOG.mdの修正です。

ActionController::Instrumentationでpathを設定するのにfullpathを使用していたのをfiltered_pathを使用するよう修正した、use filtered_path in action_controller event payloads instead of fullpathの対応のCHANGELOGのエントリーでメソッド名とオブジェクト名をタイポしていたのを修正しています。