I am using the acts_as_network gem which allows me to get all the friends for a User through 'User.friends'
I want to create a 'friend feed' showing all the recent events for all of the friends by searching through the Event records where Event:
Event | giver_id | receiver_id | date |
Conceptually I'd like to be able to do this:
feed = Events.giver_id_or_receiver_id_in(User.friends).date_gt(Date.today.2.weeks.ago)
This should give me an array of all events where either the giver_id or receiver_id is IN the array of friends (User.friends), created in the last two weeks.
How can I do this?