The error message says it all - it''s not currently possible to do a
has_many :through on a polymorphic association...
--Matt Jones
On Jul 23, 8:29 pm, BenP
<benpe...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
wrote:> 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?