↧
Answer by Linus Oleander for Creating a feed (following) grouped by day and...
Here's is one solution.current_user_id = current_user.idPhoto.select(%q{ user_id, COUNT(*) no_photos, date_trunc('day', created_at::timestamp) as what_day}).group("what_day, user_id").order("what_day...
View ArticleCreating a feed (following) grouped by day and user that is ordered by most...
I am trying to do a feed (kinda timeline following feed in a daily manner)I have a table photos where it stores photos uploaded by the user, a table follows which stores the user that each user is...
View Article