Rails: print associations in ActiveRecord inspectors
- by marienbad
When I print an ActiveRecord of a Department, I get:
Department:0x210ec4c {
:id = 3,
:name = "Computer Science",
...
:school_id = 3
}
How can I make it give me the School instead of the School_ID? In other words, call to_s on the school found by the school_id. Just like how when I have a Department d, I can say
d.school