Hacker News new | past | comments | ask | show | jobs | submit login

  Viewer.visible(current_account.posts, to: current_user)
That's essentially a function inside a module/namespace. You aren't making a separate class/object for it.



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.




Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: