# Polymorphic has\_many through source problem

**URL:** <https://www.ruby-forum.com/t/polymorphic-has-many-through-source-problem/172626>\
**Category:** Rails\
**Created:** [July 24, 2009, 9:02am UTC](https://www.ruby-forum.com/t/polymorphic-has-many-through-source-problem/172626 "2009-07-24T09:02:03Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![BenP](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/c37758/32.png) [@BenP](https://www.ruby-forum.com/u/BenP)\
**Post date:** [July 24, 2009, 9:02am UTC](https://www.ruby-forum.com/t/polymorphic-has-many-through-source-problem/172626/1 "2009-07-24T09:02:03Z")

</div>

My issue is as follows:

I have a model with 2 polymorphic associations - authorisable and  
permissible.

In my current example, permissible represents an Account model and  
authorisable is a User model

I need to be able to do find the users in an account by @account.users

Account.rb

has\_many :permissions, :as =\> :permissible  
has\_many :users, :through =\> :permissions, :source =\> :authorisable

Permission.rb  
belongs\_to :permissible, :polymorphic =\> true  
belongs\_to :authorisable, :polymorphic =\> true

The error I’m receiving is:  
Cannot have a has\_many :through association ‘Account#users’ on the  
polymorphic object ‘Authorisable#authorisable’

I’m confused, can anybody help?

---

<div class="post-metadata">

**Author:** ![BenP](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/c37758/32.png) [@BenP](https://www.ruby-forum.com/u/BenP)\
**Post date:** [July 24, 2009, 7:15pm UTC](https://www.ruby-forum.com/t/polymorphic-has-many-through-source-problem/172626/2 "2009-07-24T19:15:11Z")

</div>

The error message says it all - it’s not currently possible to do a  
has\_many :through on a polymorphic association…

–Matt J.
