Hacker News new | ask | show | jobs
by Spivak 1405 days ago
> It's great if your users are disciplined and experienced Rails engineers who understand how the system works.

I'm continuously shocked at how much bad ActiveRecord code there is lying around given that it's so easy to just look at the SQL it generates and be like "yeah this looks reasonable".

WHY SPONGEBOB WHY!?! Why do you pass around your relations making all of ActiveRecord part of your external API? It's so hard to do stupid things with AR if you pretend that AR objects can't leave the scope they were fetched in.

1 comments

> given that it's so easy to just look at the SQL it generates and be like "yeah this looks reasonable".

This makes the assumption that the viewer knows what reasonable SQL looks like in the first place.