|
|
|
|
|
by geospeck
2106 days ago
|
|
That is very interesting approach! I’ve never worked on a project that doesn’t use AR relationships e.g has_many...
at all. Do you have an example app or a blog post exposing this pattern? It would be very interesting to see how this actually works. Thanks you very much for bringing this up! |
|
That may seem weird, but the association still has value: for querying. You can still write: User.joins(:posts) for example.
The problem with the association methods is that they aren’t really methods because they always execute a query. A lot of longtime Rails developers get tired of the database being involved in every step of the way in a request, because it leads to a lack of separation of concerns.