|
|
|
|
|
by amw-zero
2106 days ago
|
|
They aren’t saying to not use has_many. They’re saying to not use the association method that gets put on the AR object from has_many. For example, if a User has_many Posts, they’re saying to avoid calling user.posts. 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. |
|