On 11 June 2010 20:10, Michael Pavling <[email protected]> wrote:
> Bar.all(:joins => :foos).uniq
Seems to... quick and dirty test on one of my models:
>> Person.all(:include => :graduations).select { |person|
>> !person.graduations.empty? }.size
=> 87
>> Person.all(:include => :graduations).select { |person|
>> person.graduations.size > 0 }.size
=> 87
>> Person.all(:joins => :graduations).size
=> 103
>> Person.all(:joins => :graduations).uniq.size
=> 87
>>
--
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.