News for hackers. Stuff that matters.
Re:Django and Postgres for the Busy Rails Developer by Tainnor on Thursday December 12, 2024 @04:46PM (#42403750)
Your business logic should not be tied your persistence, that's what I mean by it.

By "domain objects" I don't mean that you need to embrace OOP, they could be simple structs without any associated logic.

> PPS - N+1 queries are kinda trivial to resolve in most cases in Rails? There's core ORM functionality for it.

The problem isn't that you can't fix N+1 queries in Rails, it's that it's incredibly easy to create them by accident because your ActiveRecord objects carry a DB connection around everywhere, even in views.

Re:Django and Postgres for the Busy Rails Developer by RangerScience on Friday December 13, 2024 @10:20PM (#42414412)
Ah! Then we're in agreement :)

And yes, Rails makes it easy to make "unthinking" mistakes - like, you should prep your ActiveRecord objects in the controller so they've got all their data for the view, but, because you don't have to...

Blessing and a curse. You can turn it on and pretty much immediately get started, but that doesn't mean you know what you're doing...