Robert Walker wrote in post #1137052:
> Robert Walker wrote in post #1137051:
>> @users.where({ name: @request.requester, name:
>> @request.regional_sales_mgr }).all
>>
>> Just note that this would never return any results since "name" can only
>> have one value at a time.

Sorry! for making you confused.

Look the below :

Buyer.joins(:products).where({'product.id' => [11,21,13]})

It will give us all buyers who bought a product having ID (11 or 21 or 
13).

But I want those buyers who bought all products(i.e 11 and 21 and 13).

Hope now my question makes sense now. :-)

-- 
Posted via http://www.ruby-forum.com/.

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/rubyonrails-talk/6b0581eed2cee2d9a2abababfa039996%40ruby-forum.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to