Hi Rick, On Fri, Jun 11, 2010 at 1:26 PM, Rick DeNatale <[email protected]> wrote: > I'm having a senior moment. I've done this before but I can't remember how. > > Two active record models, > > Foo belongs_to Bar > > Bar has_many Foos > > I want to find all Bars that have at least one Foo, is it: > > Bar.all(:include => :foos, :conditions => "foo.id IS NOT NULL')
Seems like it would be 'foo.bar_id' in the condition clause. HTH, Bill -- 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.

