This is my favorite part of the piece:
"I far prefer current_account.posts.visible_to(current_user) to involving a third query object."
I couldn't agree more.
People treating the single responsibility principle as the holy grail keep advocating an object for everything. In more complex cases, you may need an object for something, but not in every case. In those simpler cases, I think something like what DHH's example advocates is more appropriate.
That's essentially my beef with most query objects. Wrapping a query in an object like that is usually too much ceremony for something that's just a method.
It doesn't get any better by having Viewer.new(current_account.posts, current_user).visibles or #execute or whatever else you'd do in a query object.
I couldn't agree more.
People treating the single responsibility principle as the holy grail keep advocating an object for everything. In more complex cases, you may need an object for something, but not in every case. In those simpler cases, I think something like what DHH's example advocates is more appropriate.