I am a recent convert from PHP, specifically CakePHP. When I would run
a query in CakePHP and read that query into an array, I could run a
function debug() on that array and it would print all of the contents
of that array very neatly on the screen. If I run a query like @order
= Order.find(1), it reads all of the order information as well as the
related line_items information into the @order variable, but when i
run @order.inspect I can only see the order information (and not the
associated line_items) and it also reads it out in one long string
instead of each hashed value on a new line etc.. Is there a better
method than inspect to print the contents of a variable more legibly
to the screen?
is there anyway to see the related information as well? Like a query
that returns a post and all related comments. Debug only seems to show
the post but not the comments.