なるようになるブログ

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

rails commit log流し読み(2025/03/31)

2025/03/31分のコミットです。

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

actionpack/CHANGELOG.md


Merge pull request #54833 from heka1024/add-must-understand

actionpack/lib/action_controller/metal/conditional_get.rbactionpack/lib/action_dispatch/http/cache.rbの修正です。

RFC 9111で追加された、Cache-Control headerのmust-understand directiveのサポートを追加しています。must-understand directiveを指定したい場合、must_understandメソッドを使用すれば良いようにになっています。

class ArticlesController < ApplicationController
  def show
    @article = Article.find(params[:id])

    if @article.special_format?
      must_understand
      render status: 203 # Non-Authoritative Information
    else
      fresh_when @article
    end
  end
end

参考:RFC 9111: HTTP Caching


Merge pull request #54834 from kakudou3/add-script-path-to-api-app-test

railties/test/generators/api_app_generator_test.rbの修正です。

api app generatorのテストで、scriptディレクトリがアプリ生成時に生成される事を確認するよう修正しています。