# Joins, Joins, Joins! Or Not?

**URL:** <https://www.ruby-forum.com/t/joins-joins-joins-or-not/156571>\
**Category:** Rails\
**Created:** [December 30, 2008, 7:07am UTC](https://www.ruby-forum.com/t/joins-joins-joins-or-not/156571 "2008-12-30T07:07:45Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![joergbattermann](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/edb3f5/32.png) [@joergbattermann](https://www.ruby-forum.com/u/joergbattermann)\
**Post date:** [December 30, 2008, 7:07am UTC](https://www.ruby-forum.com/t/joins-joins-joins-or-not/156571/1 "2008-12-30T07:07:45Z")

</div>

Good morning,

I have a quick joins-related question:

I have a a list of followings (User following another user’s activity)  
which basically have these followed users’ ids under ‘followable\_id’.  
now what I want to do and finally have is to take these followed users  
and check what activities they have. each activity has a .user\_id. how  
would I do this?

So Basically

A User is following X other Users (polymorphic intermediate model… a  
User can also follow discussions etc). Each of those users has a set  
of activities.

What I basically want in a ‘speedy’ way is to get all followed users’  
activities.

I kinda have a problem with the polymorphism of the Follow model, as  
apparently I cannot put a has\_many relationship into the user model  
which would allow me a condition (followable\_type = “User”), class  
(User) and source (:followable)…

I am kinda lost… been wrangling with join conditions all night :-/

Any ideas / suggestions? Would be highly, highly appreciated…!

Cheers,  
-Joerg

---

<div class="post-metadata">

**Author:** ![joergbattermann](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/edb3f5/32.png) [@joergbattermann](https://www.ruby-forum.com/u/joergbattermann)\
**Post date:** [December 30, 2008, 9:32am UTC](https://www.ruby-forum.com/t/joins-joins-joins-or-not/156571/2 "2008-12-30T09:32:46Z")

</div>

i’m not sure if i understand correctly what you are doing. could you  
post your models and relations so far?
