# Has\_many\_polymorphs + has\_many\_through joins?

**URL:** <https://www.ruby-forum.com/t/has-many-polymorphs-has-many-through-joins/135753>\
**Category:** Rails\
**Created:** [April 24, 2008, 5:12pm UTC](https://www.ruby-forum.com/t/has-many-polymorphs-has-many-through-joins/135753 "2008-04-24T17:12:03Z")\
**Posts on this page:** 1\
**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:** [April 24, 2008, 5:12pm UTC](https://www.ruby-forum.com/t/has-many-polymorphs-has-many-through-joins/135753/1 "2008-04-24T17:12:03Z")

</div>

Hello there,

I have a user model, which has man relationships to other users via a  
hmt association.

Then there is a hmp association (user.items) from each user to lots of  
different other models (e.g. images, videos, etc).

Now how do I get all (or the last 25 etc) .items from a users related  
users?

user.relationships gives x users  
e.g. user.relationships[0] gives y items. but how do I get all .items  
from all .relationships?

I am kinda lost at the moment ☹ Any ideas / suggestions?

-J
