How to make WHERE foo_id IN () query?


There are 3 models:
A has_many :Cs
B has_many :Cs
C belongs_to A and B

I got a single object of A and an array of B objects. How can I get
all Cs that have a_id equal to object and b_id that belongs to
an object in Bs array?


On 4 Jul 2008, at 16:56, szimek wrote:

an object in Bs array?

C.find_all_by_a_id_and_b_id(, [some_objects])

should work


On 4 Lip, 18:20, Frederick C. [email protected] wrote:


Thanks! I had no idea you can pass an array of AR objects to

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs