On Thu, May 27, 2010 at 10:41 AM, chewmanfoo <[email protected]> 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 => :destroy
>  has_many :networks, :through => :ip_addresses

Wouldn't

  has_many :networks, :through => :ip_addresses, :uniq => true

do it?
-- 
Hassan Schroeder ------------------------ [email protected]
twitter: @hassan

-- 
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 [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to