Last active
October 25, 2020 21:18
-
-
Save berellevy/5990ed5b052d547fee33611a6983f7b6 to your computer and use it in GitHub Desktop.
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
def feed(page_num) | |
page_qty = 5 | |
offset = page_num * page_qty | |
feed = Post.order(updated_at: :desc).where(user_id: followees_ids).limit(page_qty) | |
.offset(offset) # I broke the lines up because it gets cut off in medium.com | |
View.batch_create(self, feed) | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment