Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

awesome_print not showing associated objects

How do I get AwesomePrint.ap to show the associated objects that are nested inside an object? It doesn't do this by default and I'm assuming there's a way to force it?

like image 664
jaydel Avatar asked Dec 19 '12 18:12

jaydel


1 Answers

You can use the raw parameter, e.g.

ap my_model, raw: true

This recursively formats instance variables. You can also make it the default using AwesomePrint.defaults (Documentation)

But beware: That feature can add a large amount of noise, especially when printing Rails related object instances. (especially ActiveRecord::Base)

like image 91
Daniel Rikowski Avatar answered Oct 26 '22 22:10

Daniel Rikowski