Re: [Rails] has_many :through association not working properly

2010-05-27 Thread Hassan Schroeder
On Thu, May 27, 2010 at 10:41 AM, chewmanfoo wrote: > ISSUE: > The host has 3 ip addresses on two networks (#62 is repeated) > How do I get host.networks to return only the two networks? > ## network_hosts model > class NetworkHost < ActiveRecord::Base > >  has_many :ip_addresses, :dependent => :

[Rails] has_many :through association not working properly

2010-05-27 Thread chewmanfoo
ISSUE: The host has 3 ip addresses on two networks (#62 is repeated) How do I get host.networks to return only the two networks? >> host => # >> host.ip_addresses.size => 3 >> host.networks => [#, #, #] >> host.networks.size => 3 ## networks model class Network < ActiveRecord::Base