2025/12/13分のコミットです。
CHANGELOGにのったコミットは以下の通りです。
Merge pull request #56353 from rails/rmf-delegation-basic-object
activesupport/lib/active_support/delegation.rbの修正です。
delegat、及び、delegate_missing_toがBasicObjectのsubclassesだと、定義に問題があった場合にexceptionをraise出来ないバグがあったのを修正しています。
Document PARALLEL_WORKERS threshold bypass behavior
activesupport/lib/active_support/test_case.rbのdoc、及び、
rails guideのTesting Rails Applicationsの修正です。
PARALLEL_WORKERS envが指定されている場合、テスト数に関わらずenvに指定されただけのworkerが実行される旨説明を追加しています。
Merge pull request #56350 from rosa/sec-fetch-site-for-forgery-protection
Action Pack、railtiesの修正です。
CSRF protectionをSec-Fetch-Site headerをチェックする形のロジックに修正しています。デフォルトはSec-Fetch-Site headerと元のtoken両方をチェックするアプローチになっています。load_defaultsに8.2を指定するか、config.action_controller.forgery_protection_verification_strategyに:header_onlyを指定した場合、Sec-Fetch-Site headerをチェックするだけになるようになっています。また、controllerでも挙動を指定出来るようになっています。
class ApplicationController < ActionController::Base # `Sec-Fetch-Site` headerだけをチェック protect_from_forgery using: :header_only, with: :exception # `Sec-Fetch-Site` headerが無い場合tokenでチェック protect_from_forgery using: :header_or_legacy_token, with: :exception # cross-site requestsを許可するtrusted originsを指定 protect_from_forgery trusted_origins: %w[ https://accounts.google.com ] end
Active Support notifications for CSRF warnings (#56355)
Action Packの修正です。
CSRF token check にfallbackした場合などの、CSRFに関するwarningがlogger経由でログに出力していたのを、Action Support notificationを使用して出力するよう修正しています。
Update with_lock docs to mention yielded transaction (#56346)
activerecord/lib/active_record/locking/pessimistic.rbのdoc、及び、
rails guideのActive Record Query Interfaceの修正です。
with_lockにblockを指定した場合に、blockの引数にtransaction objectが渡される旨docに説明を追加しています。
Fix protect_from_forgery to use the default value from config (#56356)
actionpack/lib/action_controller/metal/request_forgery_protection.rbの修正です。
config.action_controller.forgery_protection_verification_strategyを指定している場合にその値が無視されてしまうバグがあったのを修正しています。
Merge pull request #55928 from Shopify/batch_reset_sequence
Active Recordの修正です。
fixtureを使用している場合のPostgreSQLのsequenceのリセット処理をbulkで行うよう修正しています。テーブルが大量にある場合、sequenceのリセットを個別にやると大分処理が遅くなってしまうため。