Forum: Ruby on Rails multiple has_many :through

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
Claudio P.  (Guest)
on 2007-03-04 04:46
(Received via mailing list)
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 ;; 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.