Quantcast
Channel: Rails public_activity feed with polymorphic following - Stack Overflow
Viewing all articles
Browse latest Browse all 3

Rails public_activity feed with polymorphic following

$
0
0

I am using two gems in my app, public_activity and acts_as_follower. I've got acts_as_follower set up fine where a user can follow another user as well as bands.

The problem is making a feed out of the activity from the objects you are following. Using Public activity, I have a global feed using the recommended method:

@activities = PublicActivity::Activity.order("created_at desc")

That works fine. However I would like also to have a following feed, which would reqiure something along the lines of:

@activities = PublicActivity::Activity.order("created_at desc").where(owner_id: current_user.all_following, owner_type: ????????)

Without specifying owner_type, a feed is created using only owner_id which is a problem because a user and a band can have the same id. How might I specify the owner type in this case?


Viewing all articles
Browse latest Browse all 3

Latest Images

Trending Articles





Latest Images