Created
January 27, 2013 21:40
-
-
Save mb-dev/4650744 to your computer and use it in GitHub Desktop.
Russian Doll Caching - Post Presenter
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class PostPresenter | |
def initialize(post) | |
@post = post | |
end | |
def comments | |
Comment.includes(:user).where(post_id: @post.id) | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment