なるようになるブログ

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

rails commit log流し読み(2025/08/30)

2025/08/30分のコミットです。

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

activesupport/CHANGELOG.md

actionpack/CHANGELOG.md


Makes a parallel_worker_id value available when running tests

activesupport/lib/active_support/test_case.rbactivesupport/lib/active_support/testing/parallelization/worker.rbの修正です。

parallel testsでテストを実行しているworkerのIDをActiveSupport::TestCase.parallel_worker_idで取得出来るよう修正しています。


The context_store setter is defined on the class, not the instance

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

アプリケーション初期化時に、Event Reporterのcontext storeの設定が正しく行えてないバグがあったのを修正しています。


Fix changelogs linter offense

activesupport/CHANGELOG.mdの修正です。

ファイル内に不要なスペースがあったのを削除しています。


Add markdown mime type and renderer (#55511)

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

デフォルトでサポートするmime type及びrendererにmarkdownを追加しています。markdowmへの変換処理は、対象にto_markdownメソッドが定義されている必要があり、このメソッドはアプリ側で対応する必要があります(Railsとしてはメソッドは提供していない)。

class Page
  def to_markdown
    body
  end
end

class PagesController < ActionController::Base
  def show
    @page = Page.find(params[:id])

    respond_to do |format|
      format.html
      format.md { render markdown: @page }
    end
  end
end

Fix typo in Rails 8.0 release notes: 'registery_directory' → 'register_directory'

rails guideのRuby on Rails 8.0 Release Notesの修正です。

Rails::CodeStatistics.register_directoryRails::CodeStatistics.registery_directoryにタイポしていたのを修正しています。


Allow getter and setter for options[:namespace] in ActiveSupport::Cache::Store

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

ActiveSupport::Cache::Storeにnamespaceのgetter/setterメソッドを追加しています。開発やテストでnamespaceを動的に変更したい事がある(e.g.: parallel testsでテストを実行している場合に、worker毎にユニークなnamespaceを指定する)ため、との事です。