console

Imagine: you open a rails console and type User.limit(100). The output shows your database call, then… ACTIVE RECORD GUT PUNCH!!! Your screen is overrun with an inscrutable wall of text. I hated it. I had some coping mechanisms, but they were cumbersome. For example, the map-and-print: puts User.all.map { |u| "#{u.id}, #{u.email}, #{u.bio}" }.join("\n"); 0 This still sucked. Tons of typing, mid-line typos, forgetting to start with ‘puts’, accidentally returning the whole array - and the output was better but still not great.
2013-02-22
3 min read