There is a model that uses serialize
to save Array
, but the array part is a little big, and when I view it in the Rails Console, other columns flow quickly, making it very difficult to handle.
foo=Foo.fisrt
# <Foo:0x0000000000000>{
: id=>1,
# It's hard to use because the display here quickly flows.
:serialized_column=>[
# an array that is about the amount of a terminal screen
]
}
This is what the condition looks like.
I wanted to prevent this serialized_column
from being displayed unless I explicitly called it. Is there any way?
I thought I should overwrite inspect
, but it seems to be called in a different way, so there was no change in the override.
Also, I want to make sure that even if I overwrite it, it only affects the development environment.
A gem called Hirb can shape record output.
I don't have data like serialized_column, so I haven't confirmed it yet, but I might be able to adjust it.
https://github.com/cldwalker/hirb
© 2024 OneMinuteCode. All rights reserved.