From e86bf64ee3c850ac9b975c221816c2a6bf746ea8 Mon Sep 17 00:00:00 2001 From: Sebastian Serth Date: Wed, 2 Oct 2024 03:35:47 +0200 Subject: [PATCH] Show all attributes when inspecting an object in production Otherwise, only the `id` is shown by default (in contrast to `full_inspect`). This behavior has changed with Rails 7.2, and previously showed all information by default. Since we often use `inspect` within the application to get details about unexpected errors, we want to keep the previous behavior. --- config/environments/production.rb | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/config/environments/production.rb b/config/environments/production.rb index da0ac8ba8..c54de0aeb 100644 --- a/config/environments/production.rb +++ b/config/environments/production.rb @@ -114,4 +114,8 @@ # ] # Skip DNS rebinding protection for the default health check endpoint. # config.host_authorization = { exclude: ->(request) { request.path == "/up" } } + + # Show all attributes when inspecting an object. + # Otherwise, only the `id` is shown by default (in contrast to `#full_inspect`). + config.active_record.attributes_for_inspect = :all end