2025/01/18分のコミットです。
CHANGELOGにのったコミットは以下の通りです。
- Use
secret_key_basefrom ENV or credentials when present locally. - Add
application-namemetadata to application layout
Merge pull request #54280 from Shopify/ac-through-assoc-reverts
最近対応が行われた下記のhas-many-through association関係の対応をまとめてRevertしています。 has_many_through associations + join modelの作成処理でリグレッションが発生している為。合わせて、左記パターンの為のテストを追加しています。
- Skip persisted through targets when autosaving collection associations
- Handle polymorphic collection associations when setting through records
- Handle nested middle belongs_to, not-loaded target when setting through records
- Handle setting of nested through records for new records
- [Fix #33155] Set through target for new records
Merge pull request #54253 from viktorianer/fix/port-bindings
railties/lib/rails/generators/rails/devcontainer/templates/devcontainer/Dockerfile.ttの修正です。
rails newで生成するDockerfile内でENV BINDING="0.0.0.0"を指定するよう修正しています。PodmanなどのDocker以外のランタイムを使用した場合も使えるようにする為。
Use secret_key_base from ENV or credentials when present locally
railties/lib/rails/application.rb、
railties/lib/rails/application/configuration.rbの修正です。
develoment、及び、test envではsecret key baseに必ずtmp/local_secret.txtが使用されいたのを、ENV["SECRET_KEY_BASE"]、または、Rails.application.credentials.secret_key_baseが設定されている場合、せっていされている値を使用するよう修正しています。ファイルでの管理だと、CIなどでテストをparallelで実行した場合にファイル生成処理の競合でエラーになる可能性があり、そのような場合にファイルに依存するのを避けれれうようにする為。
Load schema for Author table in test
activerecord/test/cases/instrumentation_test.rbの修正です。
テストで使用するtableのschemaのloadが不足している箇所があったのを修正しています。
Add application-name metadata to application layout
railties/lib/rails/generators/rails/app/templates/app/views/layouts/application.html.erb.ttの修正です。
rails newで新規にアプリケーションを作成した際に、layoutファイルのapplication-name metaタグにアプリケーション名を指定するよう修正しています。
<meta name="application-name" content="Name of Rails Application">
参考:
- Standard metadata names - HTML: HyperText Markup Language | MDN
- html - What is the purpose of application-name and keywords in meta tag? - Stack Overflow
Refine step in the Sprockets to Propshaft migration guide
rails guideのThe Asset Pipelineの修正です。
SprocketsからPropshaftへのmigration方法のCSSファイルでの対応について説明している箇所に、これはCSSファイル向けの対応である旨説明を追加しています。
Doc: Format CSRF argument lists
actionpack/lib/action_controller/metal/request_forgery_protection.rbのdocの修正です。
ActionController::RequestForgeryProtectionのメソッドの引数について説明している箇所のdocのフォーマットを修正しています。