On Wed, May 12, 2010 at 4:47 PM, Jesse <draco...@gmail.com> wrote: > Sure thing: > > class Portal < ActiveRecord::Base > has_many :users, :through => :programs > end > > class Program < ActiveRecord::Base > has_many :users, :through => :program_memberships > end > > class User < ActiveRecord::Base > has_many :program_memberships, :dependent => :destroy > has_many :programs, :through => :program_memberships > has_many :portals, :through => :programs > end
I'm pretty sure that Rails 2.x still doesn't support transitive has_many :through associations https://rails.lighthouseapp.com/projects/8994/tickets/1152-support-for-nested-has_many-through-associations There appears to be a plugin, although I've never used it personally. http://github.com/ianwhite/nested_has_many_through -- Rick DeNatale Blog: http://talklikeaduck.denhaven2.com/ Github: http://github.com/rubyredrick Twitter: @RickDeNatale WWR: http://www.workingwithrails.com/person/9021-rick-denatale LinkedIn: http://www.linkedin.com/in/rickdenatale -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-t...@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.