Topic: Merge Queries
i would like to build an activity feed on my site. i setup a model Activity. the issue is that i would like to do 2 specific queries and merge them into one "feed".
Activity ID | USER_ID | ACTIVITY_TYPE | DESCRIPTION //get all activities for user 1,2,3, any ACTIVITY_TYPE activities = Activity.where(:user_id => [1,2,3]) //get activities for user 4, only ACTIVITY_TYPE = 1 activities_per_user = Activity.where(:user_id => 4, :activity_type => 1)
how can i merge both queries into one array, sort by date and still do pagination with will_paginate?