rails 7.2からrails 8.0への移行(アップデート、アップグレード)で必要な作業

wakairo @wakairo

Rails 8.0におけるaction_controller.perform_cachingとaction_mailer.perform_caching

config.action_controller.perform_cachingconfig.action_mailer.perform_cachingは、両方ともキャッシュ機能を有効にするかどうかの設定です。

rails newで生成されるconfig/environments/test.rbにおいて、 8.0からは以下のようにこれらの設定を無効にするコードが削除されました(この変更のPRこの変更のCommit)。

-  # Show full error reports and disable caching.
+  # Show full error reports.
   config.consider_all_requests_local = true
-  config.action_controller.perform_caching = false
   config.cache_store = :null_store
-  # Disable caching for Action Mailer templates even if Action Controller
-  # caching is enabled.
-  config.action_mailer.perform_caching = false

公式として8.0からはテスト環境ではキャッシュが効いた状態を標準とするということだと思いますので、既存アプリでも同じ設定変更、つまり、設定の削除をしても良いかもしれません。

0
Raw
https://www.techtips.page/en/comments/657
Last edited · 3587 views