Open MadBomber opened 1 year ago
Hey there! I think there's some confusion about how this currently works and it probably could use some improvement.
This is only used by the object formatter https://github.com/amazing-print/amazing_print/blob/8c0ae339e309b27badf45ec92bd5fb1176ed5c31/lib/amazing_print/formatters/object_formatter.rb#L65-L66
This object formatter is only used when a specialized formatter doesn't match the object, raw: true
is set, and the object has at least one instance variable.
https://github.com/amazing-print/amazing_print/blob/8c0ae339e309b27badf45ec92bd5fb1176ed5c31/lib/amazing_print/formatter.rb#L43-L51
require 'amazing_print'
thread = Thread.new {}
ap thread, raw: true, object_id: false
#<Thread:0x00007fd2e7111f18 (irb):3 dead>
nil
require 'ostruct'
obj = OpenStruct.new(pizza: "place")
ap obj, raw: true, object_id: false
#<OpenStruct
attr_reader :table = {
pizza: "place"
}
>
nil
The object_id option is not doing what I expect so either there is a software problem or a wetware problem.
Software Versions: Amazing ... 1.4.0 Ruby ...... 3.0.1p64 Rails ..... 6.1.3
Running the Rails Console/Irb ....
irb(main):002:0> c = Clinician.first Clinician Load (1.1ms) SELECT "clinicians".* FROM "clinicians" ORDER BY "clinicians"."id" ASC LIMIT $1 [["LIMIT", 1]] =>
<Clinician:0x000000012838e2c0