Forum: Ruby on Rails multiple has_many :through

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
25e782eb7e799e78d781b0026fc6a4d8?d=identicon&s=25 Claudio Poli  (Guest)
on 2007-03-04 03:46
(Received via mailing list)
hi,
simplifying I've this:

user -> membership -> group -> grant -> right
user has_many group through membership and group has_many right
through grant.
I can fetch the groups' rights well, doing some console stuff like
@user.groups.each do |group| ;; group.rights.each do |right| ;; puts
right.name ;; end  ;; end etc.
it would be very powerful to be able to do @user.rights directly
with :uniq instead of querying groups' rights, anybody can think of an
association like this?
This topic is locked and can not be replied to.